Remap Keys on your Keyboard in Linux
sleepyeyesvince
We look at how we can remap keys on your keyboard in Linux with Xorg, using xmodmap. In my example, I'll remap the Context Menu key to Right Super, since this key is missing on some keyboards, being replaced by a Function key for multimedia functions.
Determine the keycode of the key you want to remap using this command: xev | awk -F'[ )]+' '/^KeyPress/ { a[NR+2] } NR in a { printf "%-3s %s\n", $5, $8 }'
Press the key you want to remap to obtain the keycode: 135 Menu In this example, the keycode is "135" and the keysym is "Menu"
In a text editor, enter this line: keycode 135 = Super_R
Save the file in your home directory as: .Xmodmap (don't forget the dot "." at the beginning)
To apply changes, either reboot or run this command: xmodmap ./Xmodmap
Note that if you hotplug your keyboard by unplugging and plugging it back in, you will need to reapply the changes with the above command. If you want to add comments to your .Xmodmap file, pre-append with "!" instead of "#".
Examples of other keysyms are shown here: https://wiki.archlinux.org/index.php/Xmodmap#Modifier_keys
Other articles I referenced in the the video were: https://wiki.archlinux.org/index.php/Xmodmap https://wiki.archlinux.org/index.php/Keyboard_input#Identifying_keycodes_in_Xorg
Attributions: stainless-steel-keyboard-5-1550850 Photo by Andreas Just from FreeImages
Contact me: Telegram: @sleepyeyesvince MeWe: https://mewe.com/i/sleepyeyesvince ... https://www.youtube.com/watch?v=l5LJ9tO7G74
27889586 Bytes