]> git.sur5r.net Git - i3/i3/commitdiff
t/264-keypress-numlock: add mouse binding test 2868/head
authorMichael Stapelberg <michael@stapelberg.de>
Sun, 20 Aug 2017 16:00:10 +0000 (18:00 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sun, 20 Aug 2017 16:00:58 +0000 (18:00 +0200)
fixes #2523

testcases/t/264-keypress-numlock.t

index 2fdafb8361829ffd42cf63f4d991284eab7dd8e8..fcc39ead4f492cbc1693a5fe0513b9dbbde582fa 100644 (file)
@@ -344,6 +344,47 @@ is(scalar @i3test::XTEST::binding_events, 18, 'Received exactly 18 binding event
 
 exit_gracefully($pid);
 
+################################################################################
+# Verify mouse bindings are unaffected by NumLock
+################################################################################
+
+$config = <<EOT;
+# i3 config file (v4)
+font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
+
+bindsym --whole-window button4 nop button4
+EOT
+
+$pid = launch_with_config($config);
+
+my $win = open_window;
+
+start_binding_capture;
+
+is(listen_for_binding(
+    sub {
+        xtest_key_press(77); # enable Num_Lock
+        xtest_key_release(77); # enable Num_Lock
+        xtest_button_press(4, 50, 50);
+        xtest_button_release(4, 50, 50);
+        xtest_key_press(77); # disable Num_Lock
+        xtest_key_release(77); # disable Num_Lock
+    },
+    ),
+   'button4',
+   'triggered the button4 keybinding with NumLock');
+
+is(listen_for_binding(
+    sub {
+       xtest_button_press(4, 50, 50);
+       xtest_button_release(4, 50, 50);
+    },
+    ),
+   'button4',
+   'triggered the button4 keybinding without NumLock');
+
+exit_gracefully($pid);
+
 }
 
 done_testing;