My goal is to remap a key called sysrq
on my keyboard to be Super_R
.
I know I need to first find the keycode that corresponds to the physical key that is being pressed and then remap it using xmodmap -e "keycode nnn = Super_R"
where nnn
is the keycode found whilst running xev
and pressing the physical key.
However the issue I have is that whilst running xev | grep keycode
and pressing the sysrq
key on my keyboard I get two keycodes being emitted.
$ xev | grep keycode
state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
state 0x8, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
state 0x8, keycode 107 (keysym 0xff15, Sys_Req), same_screen YES,
state 0x8, keycode 107 (keysym 0xff15, Sys_Req), same_screen YES,
state 0x8, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
The Sys_Req
key code makes sense - one for key press down and the other for key press up. But it has the Alt_L
keycode peppered in there at the same time. How do I stop that with a view to eventually remapping the sysrq
physical key to emit the Super_R
keycode?
$ showkey --keycodes
keycode 56 press
keycode 56 release
keycode 56 press
keycode 99 press
keycode 99 release
keycode 56 release
kernel: 5.13.0-27-generic #29~20.04.1-Ubuntu
os: Ubuntu 20.04.3 LTS
gnome: 3.36.8
window system: X11
laptop: starlabs starbook mk v