]> git.sur5r.net Git - i3/i3/commitdiff
t/264-keypress-numlock: add a test covering shift
authorMichael Stapelberg <michael@stapelberg.de>
Mon, 12 Sep 2016 10:10:59 +0000 (12:10 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Mon, 12 Sep 2016 10:10:59 +0000 (12:10 +0200)
related to #2418

testcases/t/264-keypress-numlock.t

index 4f255b789b7c2d50cdba6c3b79cdc498a42d261c..fa9caa61c1fcd6892e93331cb011322b707f27f8 100644 (file)
@@ -38,6 +38,9 @@ bindsym Mod4+a nop a
 
 # Binding which should work with numlock and without, see issue #2418.
 bindsym Escape nop Escape
+
+# Binding which should work with numlock and without, see issue #2418.
+bindsym Shift+Escape nop Shift+Escape
 EOT
 
 my $pid = launch_with_config($config);
@@ -114,8 +117,34 @@ is(listen_for_binding(
    'Escape',
    'triggered the "Escape" keybinding');
 
+is(listen_for_binding(
+    sub {
+        xtest_key_press(50); # Shift_L
+        xtest_key_press(9); # Escape
+        xtest_key_release(9); # Escape
+        xtest_key_release(50); # Shift_L
+    },
+    ),
+   'Shift+Escape',
+   'triggered the "Escape" keybinding');
+
+is(listen_for_binding(
+    sub {
+        xtest_key_press(77); # enable Num_Lock
+        xtest_key_release(77); # enable Num_Lock
+        xtest_key_press(50); # Shift_L
+        xtest_key_press(9); # Escape
+        xtest_key_release(9); # Escape
+        xtest_key_release(50); # Shift_L
+        xtest_key_press(77); # disable Num_Lock
+        xtest_key_release(77); # disable Num_Lock
+    },
+    ),
+   'Shift+Escape',
+   'triggered the "Escape" keybinding');
+
 sync_with_i3;
-is(scalar @i3test::XTEST::binding_events, 6, 'Received exactly 4 binding events');
+is(scalar @i3test::XTEST::binding_events, 8, 'Received exactly 8 binding events');
 
 exit_gracefully($pid);
 
@@ -159,7 +188,7 @@ is(listen_for_binding(
 # TODO: This test does not verify that i3 does _NOT_ grab keycode 87 with Mod2.
 
 sync_with_i3;
-is(scalar @i3test::XTEST::binding_events, 7, 'Received exactly 5 binding events');
+is(scalar @i3test::XTEST::binding_events, 9, 'Received exactly 9 binding events');
 
 exit_gracefully($pid);