问题
it seems that some options to setxkbmap which are listed in evdev.lst are not actually supported by the accompanying evdev file. For example ctrl:nocaps is supported but ctrl:swap_lalt_lctl is not, as evidenced by
$ grep 'ctrl:nocaps' /usr/share/X11/xkb/rules/evdev{,.lst}
/usr/share/X11/xkb/rules/evdev: ctrl:nocaps = +ctrl(nocaps)
/usr/share/X11/xkb/rules/evdev.lst: ctrl:nocaps Caps Lock as Ctrl
$ grep 'ctrl:swap_lalt_lctl_lwin' /usr/share/X11/xkb/rules/evdev{,.lst}
/usr/share/X11/xkb/rules/evdev.lst: ctrl:swap_lalt_lctl_lwin Left Alt as Ctrl, Left Ctrl as Win, Left Win as Alt
$
This is causing me to be unable to use the missing options, as detailed in my earlier question Why are some setxkbmap options ignored? As a bonus question, is there any way in which I can cause these missing options to be supported?
回答1:
I am experiencing the same issue and would be happy to find the answer to this.
I am running recent Debian Jessie with GNOME v3.14.1 on a Macbook 5,2 (Early 2009) - all other keybindings I tested so far seem to work. I have a guess for the reason:
In
"gnome-tweak-tools > Typing > Alt/Win key behaviour"
there is only this option "Ctrl is mapped to Win **keys** (And the Ctrl keys)"
--maybe this is related to the problem because I read somehwhere that GNOME overrides other keymapping settings... I tried adding the keybindings in dconf-editor; also - not working.
EDIT: I found a temporary workaround for this: Superuser Xmodmap Workaround
It's a copy&paste game followed by the command
# xmodmap /path/to/yoursavedfile
But notice that once you alter any keyboard related settings in GNOME like shortcuts or other keybindings it will override this and you have to rerun the command. It works instantly without a relogin/restart for me though. Don't know yet if it's persistent upon next boot - I will report here if it isn't!
EDIT2: Upon reboot and resume GNOME overrides keyboard settings by xmodmap.
EDIT3: I found a way to make the keyboard mapping permanent after reboot, resume & login, using this python script as an autostart script: xmodmap-reload-script found here
by creating a new .desktop file in ~/.config/autostart inspired by this template debian run python script on startup
[Desktop Entry]
Type=Application
Exec=python /path/to/your/application.py arguments
来源:https://stackoverflow.com/questions/26662464/why-does-the-file-evdev-in-usr-share-x11-xkb-rules-not-match-with-evdev-lst