I currently use two keyboard layouts with an xorg.conf like
Section "InputClass"
Identifier "Keyboard Defaults"
MatchIsKeyboard "yes"
Option "XkbLayout" "us, de"
Option "XkbOptions" "grp:caps_toggle"
EndSection
Now I want to map AltGr to use it as the context menu key. This can be done with
xmodmap -e "keycode 108 = Menu"
but only modifies the key on the first layout. How can I modify it on all layouts? Could something be done using advanced XkbOption or XkbLayout parameters?
Description. The xmodmap command edits and displays the keyboard modifier map and keymap table that client applications use to convert event keycodes into key symbols. It is usually run from the session startup script to configure the keyboard according to the personal tastes of the user.
How to remap keys with xmodmap step by step instructions. Start by making a copy of the current mappings and storing the file in your $HOME directory. Now, using nano or your favorite terminal or GUI file editor, open this file to make your desired changes. Exit the file and save changes when done.
A KeySym is an encoding of a symbol on the cap of a key. The set of defined KeySyms includes the ISO Latin character sets (1-4), Katakana, Arabic, Cyrillic, Greek, Technical, Special, Publishing, APL, Hebrew, Thai, Korean and a miscellany of keys found on keyboards (Return, Help, Tab, and so on).
A Hyper Key is a magical key which automatically presses all the standard modifiers (ctrl+shift+cmd+opt). Why would you need that? Because on macOS many of the easy to reach shortcut combinations are already used by the system or by some app.
echo -e "setxkbmap de\nxmodmap ~/.Xmodmap.DE" > ~/key-de && chmod +x ~/key-de
echo -e "setxkbmap us\nxmodmap ~/.Xmodmap.US" > ~/key-us && chmod +x ~/key-us
xmodmap -pke > ~/.Xmodmap.DE
xmodmap -pke > ~/.Xmodmap.US
Now just edit ~/.Xmodmap* as you like and attach shortcuts to scripts ~/key-de and ~/key-us.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With