diff options
author | Ran Benita <ran234@gmail.com> | 2012-09-13 11:49:02 +0300 |
---|---|---|
committer | Ran Benita <ran234@gmail.com> | 2012-09-14 00:07:55 +0300 |
commit | 8862fd80823c9c418b5adb5c7c183446094368d9 (patch) | |
tree | 178b71eb3942b5b2d2374ce7efa84d8b3c11b26c /test/keyseq.c | |
parent | dd6124ca0782745189d9bece3b0eae27d5e2bcba (diff) |
keyseq: test that de(neo) is working properly
This layout stretches us pretty well, so it's good for testing nothing
breaks. There are a couple of things that need looking into, though
(particularly the level5 issue).
Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'test/keyseq.c')
-rw-r--r-- | test/keyseq.c | 76 |
1 files changed, 75 insertions, 1 deletions
diff --git a/test/keyseq.c b/test/keyseq.c index 5539799..c7d0918 100644 --- a/test/keyseq.c +++ b/test/keyseq.c @@ -138,7 +138,7 @@ main(void) assert(ctx); keymap = test_compile_rules(ctx, "evdev", "evdev", - "us,il,ru", ",,phonetic", + "us,il,ru,de", ",,phonetic,neo", "grp:alt_shift_toggle,grp:menu_toggle"); assert(keymap); @@ -202,6 +202,7 @@ main(void) KEY_F, BOTH, XKB_KEY_hebrew_kaph, NEXT, KEY_COMPOSE, BOTH, XKB_KEY_ISO_Next_Group, NEXT, KEY_COMPOSE, BOTH, XKB_KEY_ISO_Next_Group, NEXT, + KEY_COMPOSE, BOTH, XKB_KEY_ISO_Next_Group, NEXT, KEY_O, BOTH, XKB_KEY_o, FINISH)); assert(test_key_seq(keymap, @@ -293,6 +294,79 @@ main(void) KEY_RIGHTSHIFT, UP, XKB_KEY_Shift_R, NEXT, KEY_V, BOTH, XKB_KEY_Cyrillic_ZHE, FINISH)); +#define KS(name) xkb_keysym_from_name(name) + + /* Test that levels (1-5) in de(neo) symbols map work. */ + assert(test_key_seq(keymap, + /* Switch to the group. */ + KEY_COMPOSE, BOTH, XKB_KEY_ISO_Next_Group, NEXT, + KEY_COMPOSE, BOTH, XKB_KEY_ISO_Next_Group, NEXT, + KEY_COMPOSE, BOTH, XKB_KEY_ISO_Next_Group, NEXT, + + /* Level 1. */ + KEY_1, BOTH, XKB_KEY_1, NEXT, + KEY_Q, BOTH, XKB_KEY_x, NEXT, + KEY_KP7, BOTH, XKB_KEY_KP_7, NEXT, + KEY_ESC, BOTH, XKB_KEY_Escape, NEXT, + + /* Level 2 with Shift. */ + KEY_LEFTSHIFT, DOWN, XKB_KEY_Shift_L, NEXT, + KEY_1, BOTH, XKB_KEY_degree, NEXT, + KEY_Q, BOTH, XKB_KEY_X, NEXT, + KEY_KP7, BOTH, KS("U2714"), NEXT, + KEY_ESC, BOTH, XKB_KEY_Escape, NEXT, + /* + * XXX: de(neo) uses shift(both_capslock) which causes + * the interesting result in the next line. Since it's + * a key release, it doesn't actually lock the modifier, + * and applications by-and-large ignore the keysym on + * release(?). Is this a problem? + */ + KEY_LEFTSHIFT, UP, XKB_KEY_Caps_Lock, NEXT, + + /* Level 2 with the Lock modifier. */ + KEY_LEFTSHIFT, DOWN, XKB_KEY_Shift_L, NEXT, + KEY_RIGHTSHIFT, BOTH, XKB_KEY_Caps_Lock, NEXT, + KEY_LEFTSHIFT, UP, XKB_KEY_Caps_Lock, NEXT, + KEY_6, BOTH, XKB_KEY_6, NEXT, + KEY_H, BOTH, XKB_KEY_S, NEXT, + KEY_KP3, BOTH, XKB_KEY_KP_3, NEXT, + KEY_ESC, BOTH, XKB_KEY_Escape, NEXT, + KEY_LEFTSHIFT, DOWN, XKB_KEY_Shift_L, NEXT, + KEY_RIGHTSHIFT, BOTH, XKB_KEY_Caps_Lock, NEXT, + KEY_LEFTSHIFT, UP, XKB_KEY_Caps_Lock, NEXT, + + /* Level 3. */ + KEY_CAPSLOCK, DOWN, XKB_KEY_ISO_Level3_Shift, NEXT, + KEY_6, BOTH, XKB_KEY_cent, NEXT, + KEY_Q, BOTH, XKB_KEY_ellipsis, NEXT, + KEY_KP7, BOTH, KS("U2195"), NEXT, + KEY_ESC, BOTH, XKB_KEY_Escape, NEXT, + KEY_CAPSLOCK, UP, XKB_KEY_ISO_Level3_Shift, NEXT, + + /* Level 4. */ + KEY_CAPSLOCK, DOWN, XKB_KEY_ISO_Level3_Shift, NEXT, + KEY_LEFTSHIFT, DOWN, XKB_KEY_Shift_L, NEXT, + KEY_5, BOTH, XKB_KEY_malesymbol, NEXT, + KEY_E, BOTH, XKB_KEY_Greek_lambda, NEXT, + KEY_SPACE, BOTH, XKB_KEY_nobreakspace, NEXT, + KEY_KP8, BOTH, XKB_KEY_intersection, NEXT, + KEY_ESC, BOTH, XKB_KEY_Escape, NEXT, + KEY_LEFTSHIFT, UP, XKB_KEY_Caps_Lock, NEXT, + KEY_CAPSLOCK, UP, XKB_KEY_ISO_Level3_Shift, NEXT, + + /* Level 5. */ + KEY_RIGHTALT, DOWN, XKB_KEY_ISO_Level5_Shift, NEXT, + /* + * XXX: This doesn't work, but gives level1 keysyms. + * This does work when when de(neo) is the first layout + * (before us,il etc.). It's like that in the X server + * as well. Investigate. + */ + KEY_RIGHTALT, UP, XKB_KEY_ISO_Level5_Shift, NEXT, + + KEY_V, BOTH, XKB_KEY_p, FINISH)); + xkb_map_unref(keymap); xkb_context_unref(ctx); return 0; |