aboutsummaryrefslogtreecommitdiff
path: root/keymaps.h
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@gnu.org>2010-02-28 21:03:00 +0100
committerAurelien Jarno <aurelien@aurel32.net>2010-03-06 23:15:30 +0100
commit44bb61c8d9ad5fa0045465933b1ac8f2b1b98762 (patch)
tree34784bea640f307a4dd6c1e4bedf86cc937b97f3 /keymaps.h
parent9d0706e44a14701e8449214c4a62a5a1ca370025 (diff)
Fix curses interaction with keymaps
The combination of keymap support (-k option) and curses is currently very broken. The patch below fixes it by first extending keymap support to interpret the shift, ctrl, altgr and addupper keywords in keymaps, and to fix curses into properly using keymaps. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Diffstat (limited to 'keymaps.h')
-rw-r--r--keymaps.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/keymaps.h b/keymaps.h
index 17f6efdb6e..a7600d5751 100644
--- a/keymaps.h
+++ b/keymaps.h
@@ -51,6 +51,23 @@ typedef struct {
struct key_range *numlock_range;
} kbd_layout_t;
+/* scancode without modifiers */
+#define SCANCODE_KEYMASK 0xff
+/* scancode without grey or up bit */
+#define SCANCODE_KEYCODEMASK 0x7f
+
+/* "grey" keys will usually need a 0xe0 prefix */
+#define SCANCODE_GREY 0x80
+#define SCANCODE_EMUL0 0xE0
+/* "up" flag */
+#define SCANCODE_UP 0x80
+
+/* Additional modifiers to use if not catched another way. */
+#define SCANCODE_SHIFT 0x100
+#define SCANCODE_CTRL 0x200
+#define SCANCODE_ALT 0x400
+#define SCANCODE_ALTGR 0x800
+
void *init_keyboard_layout(const name2keysym_t *table, const char *language);
int keysym2scancode(void *kbd_layout, int keysym);