2 # vim:ts=4:sw=4:expandtab
4 # Please read the following documents before working on tests:
5 # • https://build.i3wm.org/docs/testsuite.html
8 # • https://build.i3wm.org/docs/lib-i3test.html
9 # (alternatively: perldoc ./testcases/lib/i3test.pm)
11 # • https://build.i3wm.org/docs/ipc.html
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 # (unless you are already familiar with Perl)
17 # Verifies that --release key bindings are not shadowed by non-release key
18 # bindings for the same key.
20 # Bug still in: 4.11-103-gc8d51b4
21 # Bug introduced with commit bf3cd41b5ddf1e757515ab5fbf811be56e5f69cc
22 use i3test i3_config => <<EOT;
24 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
26 bindsym Print nop Print
27 bindsym --release Control+Print nop Control+Print
30 bindsym Mod1+b nop Mod1+b
31 bindsym --release Mod1+Shift+b nop Mod1+Shift+b release
33 bindsym --release Shift+x nop Shift+x
36 use ExtUtils::PkgConfig;
39 skip "libxcb-xkb too old (need >= 1.11)", 1 unless
40 ExtUtils::PkgConfig->atleast_version('xcb-xkb', '1.11');
42 is(listen_for_binding(
44 xtest_key_press(107); # Print
45 xtest_key_release(107); # Print
50 'triggered the "Print" keybinding');
52 is(listen_for_binding(
54 xtest_key_press(37); # Control_L
55 xtest_key_press(107); # Print
56 xtest_key_release(107); # Print
57 xtest_key_release(37); # Control_L
62 'triggered the "Control+Print" keybinding');
64 is(listen_for_binding(
66 xtest_key_press(64); # Alt_L
67 xtest_key_press(56); # b
68 xtest_key_release(56); # b
69 xtest_key_release(64); # Alt_L
74 'triggered the "Mod1+b" keybinding');
76 is(listen_for_binding(
78 xtest_key_press(64); # Alt_L
79 xtest_key_press(50); # Shift_L
80 xtest_key_press(56); # b
81 xtest_key_release(56); # b
82 xtest_key_release(50); # Shift_L
83 xtest_key_release(64); # Alt_L
87 'Mod1+Shift+b release',
88 'triggered the "Mod1+Shift+b" release keybinding');
90 is(listen_for_binding(
92 xtest_key_press(50); # Shift
93 xtest_key_press(53); # x
94 xtest_key_release(53); # x
95 xtest_key_release(50); # Shift
100 'triggered the "Shift+x" keybinding by releasing x first');
102 is(listen_for_binding(
104 xtest_key_press(50); # Shift
105 xtest_key_press(53); # x
106 xtest_key_release(50); # Shift
107 xtest_key_release(53); # x
112 'triggered the "Shift+x" keybinding by releasing Shift first');