2 # vim:ts=4:sw=4:expandtab
4 # Please read the following documents before working on tests:
5 # • http://build.i3wm.org/docs/testsuite.html
8 # • http://build.i3wm.org/docs/lib-i3test.html
9 # (alternatively: perldoc ./testcases/lib/i3test.pm)
11 # • http://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
22 use i3test i3_autostart => 0;
24 use ExtUtils::PkgConfig;
27 skip "libxcb-xkb too old (need >= 1.11)", 1 unless
28 ExtUtils::PkgConfig->atleast_version('xcb-xkb', '1.11');
29 skip "setxkbmap not found", 1 if
30 system(q|setxkbmap -print >/dev/null|) != 0;
34 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
36 bindsym Print nop Print
37 bindsym Mod4+Return nop Mod4+Return
40 my $pid = launch_with_config($config);
42 start_binding_capture;
44 system(q|setxkbmap us,ru -option grp:alt_shift_toggle|);
46 is(listen_for_binding(
49 xtest_key_release(107);
53 'triggered the "Print" keybinding');
55 is(listen_for_binding(
57 xtest_key_press(133); # Super_L
58 xtest_key_press(36); # Return
59 xtest_key_release(36); # Return
60 xtest_key_release(133); # Super_L
64 'triggered the "Mod4+Return" keybinding');
66 # Switch keyboard group to russian.
69 is(listen_for_binding(
72 xtest_key_release(107);
76 'triggered the "Print" keybinding');
78 is(listen_for_binding(
80 xtest_key_press(133); # Super_L
81 xtest_key_press(36); # Return
82 xtest_key_release(36); # Return
83 xtest_key_release(133); # Super_L
87 'triggered the "Mod4+Return" keybinding');
90 is(scalar @i3test::XTEST::binding_events, 4, 'Received exactly 4 binding events');
92 exit_gracefully($pid);