Guile Really-Improved 3 Window Manager Fork of i3-wm with guile configuration
Go to file
Michael Stapelberg bf3cd41b5d Use libxkbcommon for translating keysyms, support all XKB groups.
fixes #1835

This commit improves the translation of keysyms to keycodes by loading
keymaps using libxkbcommon-x11 and using libxkbcommon for figuring out
the keymap, depending on each keybinding’s modifiers. This way, the
upper layers of complex layouts are now usable with i3’s bindsym
directive, such as de_neo’s layer 3 and higher.

Furthermore, the commit generalizes the handling of different XKB
groups. We formerly had support only for two separate groups, the
default group 1, and group 2. While Mode_switch is only one way to
switch to group 2, we called the binding option Mode_switch. With this
commit, the new names Group1, Group2 (an alias for Mode_switch), Group3
and Group4 are introduced for configuring bindings. This is only useful
for advanced keyboard layouts, such as people loading two keyboard
layouts and switching between them (us, ru seems to be a popular
combination).

When grabbing keys, one can only specify the modifier mask, but not an
XKB state mask (or value), so we still dynamically unbind and re-bind
keys whenever the XKB group changes.

The commit was manually tested using the following i3 config:

    bindsym Group4+n nop heya from group 4
    bindsym Group3+n nop heya from group 3
    bindsym Group2+n nop heya from group 2
    bindsym n nop heya
    bindsym shift+N nop explicit shift binding
    bindsym shift+r nop implicit shift binding
    bindcode Group2+38 nop fallback overwritten in group 2 only
    bindcode 38 nop fallback

…with the following layout:

    setxkbmap -layout "us,ua,ru,de" -variant ",winkeys,,neo" \
      -option "grp:shift_caps_toggle,grp_led:scroll" \
      -model pc104 -rules evdev

By default (xkb group 1, us layout), pressing “n” will result in the
“heya” message appearing. Pressing “a” will result in the “fallback”
message appearing. “j” is not triggered.

By pressing Shift+CapsLock you switch to the next group (xkb group 2, ua
layout). Pressing “a” will result in the “fallback overwritten in group
2 only” message, pressing “n” will still result in “heya”. “j” is not
triggered.

In the next group (xkb group 3, ru layout), pressing “a” will result in
the “fallback” message again, pressing “n” will result in “heya”,
“j” is not triggered.

In the last group (xkb group 4, de_neo layout), pressing “a” will still
result in “fallback”, pressing “n” will result in “heya”, pressing “j”
will result in “heya from group 4”.

Pressing shift+n results in “explicit shift binding”, pressing shift+r
results in “implicit shift binding”. This ensures that keysym
translation falls back to looking at non-shift keys (“r” can be used
instead of ”R”) and that the order of keybindings doesn’t play a role
(“bindsym n” does not override “bindsym shift+n”, even though it’s
specified earlier in the config).

The fallback behavior ensures use-cases such as ticket #1775 are still
covered.

Only binding keys when the X server is in the corresponding XKB group
ensures use-cases such as ticket #585 are still covered.
2015-08-26 09:56:42 +02:00
contrib contrib: add per-workspace-layout.pl 2014-01-26 16:51:32 +01:00
debian Update debian/changelog 2015-07-30 22:31:06 +02:00
docs Use libxkbcommon for translating keysyms, support all XKB groups. 2015-08-26 09:56:42 +02:00
i3-config-wizard Merge pull request #1816 from tcreech/tcreech-for-illumos 2015-08-04 00:10:06 -07:00
i3-dump-log Update copyright notices and get rid of ranges 2015-04-20 17:50:21 -04:00
i3-input Use safe wrappers wherever possible 2015-08-03 12:50:50 +03:00
i3-msg i3-msg: strdup getenv() result before freeing 2015-08-20 23:07:41 +03:00
i3-nagbar Use safe wrappers wherever possible 2015-08-03 12:50:50 +03:00
i3bar Use safe wrappers wherever possible 2015-08-03 12:50:50 +03:00
include Use libxkbcommon for translating keysyms, support all XKB groups. 2015-08-26 09:56:42 +02:00
libi3 Merge pull request #1816 from tcreech/tcreech-for-illumos 2015-08-04 00:10:06 -07:00
man release i3 4.10.3 2015-07-30 22:26:58 +02:00
parser-specs Use libxkbcommon for translating keysyms, support all XKB groups. 2015-08-26 09:56:42 +02:00
src Use libxkbcommon for translating keysyms, support all XKB groups. 2015-08-26 09:56:42 +02:00
testcases layout restore: remove remaining criteria when swallowing window 2015-08-06 21:35:34 +02:00
.clang-format clang-format: don’t define ForeachMacros 2014-06-19 11:17:46 +02:00
.gitignore Rebuild version.o when version.c or LAST_VERSION change 2015-04-12 12:31:58 -04:00
.travis.yml .travis.yml: add a wrapped functions grepper script 2015-08-03 12:51:39 +03:00
CONTRIBUTING.md docs: improve formatting for CONTRIBUTING 2015-08-01 14:50:55 -04:00
DEPENDS add util-{wm,keysyms} explicitly, remove obsolete xlib, update lkgv 2015-06-28 21:27:52 +02:00
LICENSE remove obsolete CMDMODE and TODO files, update LICENSE 2011-10-08 15:18:04 +01:00
Makefile Rebuild version.o when version.c or LAST_VERSION change 2015-04-12 12:31:58 -04:00
PACKAGE-MAINTAINER Introduce the i3-sensible-{pager,editor,terminal} scripts 2011-09-25 18:46:37 +01:00
RELEASE-NOTES-4.10.3 release i3 4.10.3 2015-07-30 22:26:58 +02:00
common.mk Changes for compiling on Illumos 2015-07-30 07:44:10 -04:00
generate-command-parser.pl generate parser enums stably: additionally sort on name 2015-08-05 21:23:51 +01:00
i3-dmenu-desktop Update copyright notices and get rid of ranges 2015-04-20 17:50:21 -04:00
i3-migrate-config-to-v4 Remove dead documentation for non-existing feature "stack-limit". 2015-06-09 23:13:15 +02:00
i3-save-tree i3-save-tree: retain “rect” for floating_cons 2015-08-05 22:43:18 +02:00
i3-sensible-editor Use command -v (built-in) instead of which(1) (Thanks val) 2014-10-23 23:05:01 +02:00
i3-sensible-pager Added 'pg' to i3-sensible-pager 2015-07-14 20:03:55 +12:00
i3-sensible-terminal Added terminology to i3-sensible-terminal 2015-07-28 23:00:18 +02:00
i3-with-shmlog.xsession.desktop enable shmlog when invoked as i3-with-shmlog, install symlink + .desktop file 2014-01-04 12:18:45 +01:00
i3.applications.desktop Add 'NoDisplay=true' to i3.application.desktop 2013-06-12 19:47:57 +02:00
i3.config Add 'tray_output primary' to the default config 2015-08-25 18:56:05 +02:00
i3.config.keycodes Add 'tray_output primary' to the default config 2015-08-25 18:56:05 +02:00
i3.xsession.desktop set DesktopNames (which gdm uses) (Thanks Yves-Alexis) 2014-10-23 23:18:15 +02:00
logo.svg s/i3.zekjur.net/i3wm.org/g 2011-08-28 17:44:42 +02:00
pseudo-doc.doxygen s/i3.zekjur.net/i3wm.org/g 2011-08-28 17:44:42 +02:00
release.sh release.sh: pull website repository before 2015-07-30 22:45:23 +02:00