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 when using multiple keyboard layouts at the same time, bindings
18 # without a specified XKB group will work in all XKB groups.
20 # Bug still in: 4.11-103-gc8d51b4
21 # Bug introduced with commit 0e5180cae9e9295678e3f053042b559e82cb8c98
25 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
27 bindsym Print nop Print
28 bindsym Mod4+Return nop Mod4+Return
31 use ExtUtils::PkgConfig;
34 skip "libxcb-xkb too old (need >= 1.11)", 1 unless
35 ExtUtils::PkgConfig->atleast_version('xcb-xkb', '1.11');
36 skip "setxkbmap not found", 1 if
37 system(q|setxkbmap -print >/dev/null|) != 0;
39 system(q|setxkbmap us,ru -option grp:alt_shift_toggle|);
41 is(listen_for_binding(
44 xtest_key_release(107);
49 'triggered the "Print" keybinding');
51 is(listen_for_binding(
53 xtest_key_press(133); # Super_L
54 xtest_key_press(36); # Return
55 xtest_key_release(36); # Return
56 xtest_key_release(133); # Super_L
61 'triggered the "Mod4+Return" keybinding');
63 # Switch keyboard group to russian.
66 is(listen_for_binding(
69 xtest_key_release(107);
74 'triggered the "Print" keybinding');
76 is(listen_for_binding(
78 xtest_key_press(133); # Super_L
79 xtest_key_press(36); # Return
80 xtest_key_release(36); # Return
81 xtest_key_release(133); # Super_L
86 'triggered the "Mod4+Return" keybinding');
88 # Disable the grp:alt_shift_toggle option, as we use Alt+Shift in other testcases.
89 system(q|setxkbmap us -option|);