Score:2

Multiple keycodes emitted for single keypress

de flag

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
waltinator avatar
it flag
Which supported release of Ubuntu are you using? X Windows or Wayland? What's the model of the keyboard? Have you checked the manufacturer's (of the keyboard) web site? Read https://askubuntu.com/help/how-to-ask and https://askubuntu.com/help/formatting
mez.pahlan avatar
de flag
Updated question with some more information. I've contacted the manufacturer and they don't know how to help here.
mez.pahlan avatar
de flag
Thanks @Quasímodo I've updated with the output. For a single press of my `sysrq` key I get multiple codes press and release. What does that mean? I'm out of luck?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.