keyseq: add test for repeat-shift-repeat-unshift-repeat e.g. hhhhhHHHHHHHhhhhhh with shift down and up in the middle. Unfortunately trying a quick test with test/interactive is not possible because the evdev soft-repeat stops the repeat when another key is pressed. So you need real soft-repeat for that. Signed-off-by: Ran Benita <ran234@gmail.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
diff --git a/test/keyseq.c b/test/keyseq.c
index 33510c3..2e827fc 100644
--- a/test/keyseq.c
+++ b/test/keyseq.c
@@ -27,6 +27,7 @@
enum {
DOWN,
+ REPEAT,
UP,
BOTH,
NEXT,
@@ -43,7 +44,7 @@ enum {
* - Each line in the test is made up of:
* + A keycode, given as a KEY_* from linux/input.h.
* + A direction - DOWN for press, UP for release, BOTH for
- * immediate press + release.
+ * immediate press + release, REPEAT to just get the syms.
* + A sequence of keysyms that should result from this keypress.
*
* The vararg format is:
@@ -144,6 +145,7 @@ main(void)
KEY_L, BOTH, XKB_KEY_l, NEXT,
KEY_O, BOTH, XKB_KEY_o, FINISH));
+ /* Simple shifted level. */
assert(test_key_seq(keymap,
KEY_H, BOTH, XKB_KEY_h, NEXT,
KEY_LEFTSHIFT, DOWN, XKB_KEY_Shift_L, NEXT,
@@ -153,6 +155,20 @@ main(void)
KEY_L, BOTH, XKB_KEY_l, NEXT,
KEY_O, BOTH, XKB_KEY_o, FINISH));
+ /* Key repeat shifted and unshifted in the middle. */
+ assert(test_key_seq(keymap,
+ KEY_H, DOWN, XKB_KEY_h, NEXT,
+ KEY_H, REPEAT, XKB_KEY_h, NEXT,
+ KEY_H, REPEAT, XKB_KEY_h, NEXT,
+ KEY_LEFTSHIFT, DOWN, XKB_KEY_Shift_L, NEXT,
+ KEY_H, REPEAT, XKB_KEY_H, NEXT,
+ KEY_H, REPEAT, XKB_KEY_H, NEXT,
+ KEY_LEFTSHIFT, UP, XKB_KEY_Shift_L, NEXT,
+ KEY_H, REPEAT, XKB_KEY_h, NEXT,
+ KEY_H, REPEAT, XKB_KEY_h, NEXT,
+ KEY_H, UP, XKB_KEY_h, NEXT,
+ KEY_H, BOTH, XKB_KEY_h, FINISH));
+
/* Base modifier cleared on key release... */
assert(test_key_seq(keymap,
KEY_H, BOTH, XKB_KEY_h, NEXT,