The Answer is in custom changes to Xkb configuration. I usually adjust it with my own options to make sure my Emacs key bindings work as expected and some keys like Caps Lock are mapped to useful functions.
Somehow after the change, Meta and Alt keys ended up sharing the same keycode despite having a different modifier when printed by Xmodmap
. This was the main source of confusion because this same configuration works fine on another KDE machine. To check for shared keycodes run:
xmodmap -pk | grep Alt
64 0xffe9 (Alt_L) 0xffe9 (Alt_L) 0xffe9 (Alt_L) 0xffe9 (Alt_L)
204 0x0000 (NoSymbol) 0xffe9 (Alt_L) 0x0000 (NoSymbol) 0xffe9 (Alt_L)
You'll see if Alt is sharing any of them with Meta or another modifier key. You then can work towards fixing your Xkb configuration to resolve this conflict. In my case, despite I applied my configuration last some previous steps somehow injected Meta key. You can check what options are applies by running:
setxkbmap -print -verbose 10
Setting verbose level to 10
locale is C
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules: evdev
model: pc101
layout: us,ru
Trying to build keymap using the following components:
keycodes: evdev+aliases(qwerty)
types: complete
compat: complete
symbols: pc+us+ru:2+inet(evdev)
geometry: pc(pc101)
xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwerty)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols { include "pc+us+ru:2+inet(evdev)" };
xkb_geometry { include "pc(pc101)" };
};
To test your options run:
setxkbmap -option -option your-mods
Getting through Xkb configs is not a piece of cake. Try to use already available sets of options via system settings in KDE or applying them yourself after checking in /usr/share/X11/xkb/symbols
. Look for altwin
, compose
, group
to check what they do and how.
The names of the rules to apply you can find in:
/usr/share/X11/xkb/rules/evdev.lst