aboutsummaryrefslogtreecommitdiffstats
path: root/include/utils/unix/XkeysToSkKeys.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/utils/unix/XkeysToSkKeys.h')
-rw-r--r--include/utils/unix/XkeysToSkKeys.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/utils/unix/XkeysToSkKeys.h b/include/utils/unix/XkeysToSkKeys.h
new file mode 100644
index 0000000..3d41a22
--- /dev/null
+++ b/include/utils/unix/XkeysToSkKeys.h
@@ -0,0 +1,23 @@
+#include "X11/Xlib.h"
+#include "X11/keysym.h"
+
+#include "SkKey.h"
+
+#ifndef XKEYS_TOSKKEYS_H
+#define XKEYS_TOSKKEYS_H
+
+SkKey XKeyToSkKey(KeySym keysym) {
+ switch (keysym) {
+ case XK_Right:
+ return kRight_SkKey;
+ case XK_Left:
+ return kLeft_SkKey;
+ case XK_Down:
+ return kDown_SkKey;
+ case XK_Up:
+ return kUp_SkKey;
+ default:
+ return kNONE_SkKey;
+ }
+}
+#endif