How to find the keycodes for remapping Control and Super keys using xmodmap on X11
0
votes
1
answer
874
views
I am trying to swap my Super_L and Control_L keys on my keyboard. I determine the keycodes for remapping these keys using
xev
, showkey
, and xmodmap
itself. They provide me different keycodes but none of them works when I use them to swap the functionality.
I have gone through other posts (e.g. this ) and have tried what has been suggested already. But, nothing has worked out for me. Please help me determine why my key swap is not working.
Things to note -
* key swap is working fine for other standard keys.
* key code are swapped when inspected after remap in xev
or xmodmap
but their function do not change.
* I have installed i3wm on Ubuntu 24.04.
* I have a Logitech MX Keys Mini keyboard connected to my system over bluetooth.
Keycodes without any remapping:
$ xmodmap -pke | grep -i super
keycode 133 = Super_L NoSymbol Super_L
keycode 134 = Super_R NoSymbol Super_R
keycode 206 = NoSymbol Super_L NoSymbol Super_L
$ xmodmap -pke | grep -i control
keycode 37 = Control_L NoSymbol Control_L
keycode 105 = Control_R NoSymbol Control_R
$ xev | awk -F'[ )]+' '/^KeyPress/ { a[NR+2] } NR in a { printf "%-3s %s\n", $5, $8 }'
37 Control_L
133 Super_L
$ sudo showkey kb mode was ?UNKNOWN?
[ if you are trying this under X, it might not work
since the X server is also reading /dev/console ]
press any key (program terminates 10s after last keypress)...
keycode 28 release
keycode 29 press --------- corresponds to Control_L
keycode 29 release --------- corresponds to Control_L
keycode 125 press --------- corresponds to Super_L
keycode 125 release --------- corresponds to Super_L
Asked by Lone Wolf
(31 rep)
Jul 10, 2024, 03:33 AM
Last activity: Jul 11, 2024, 03:14 AM
Last activity: Jul 11, 2024, 03:14 AM