So I’ve been using a Logitech g710+ since I switched to linux. I remapped it’s meta key to open Krunner.
And when i switched to my new keyboard (Glorius GMMK), I noticed that krunner wasn’t opening anymore. And when I run this command to check the keystrokes,
xev | awk -F'[ )]+' '/^KeyPress/ { a[NR+2] } NR in a { printf "%-3s %s\n", $5, $8 }'
i don’t see anything appear when I press that key (same with the menu/application key).
I wonder why this is happening.
Hi @Thibaultmol,
I have never worked with xev
so cannot comment on that.
However, there is another, perhaps better perhaps not, way of monitoring key presses. As you know this can then be bound to shortcuts or actions. This is all executed in the terminal, by the way.
The first step is to identify the device you’re using and getting it’s id. this can be done with the xinput list
command:
$ xinput list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ ROCCAT ROCCAT Kone EMP Consumer Control id=10 [slave pointer (2)]
⎜ ↳ ROCCAT ROCCAT Kone EMP Mouse id=9 [slave pointer (2)]
⎜ ↳ ckb1: CORSAIR K68 RGB Mechanical Gaming Keyboard vM id=14 [slave pointer (2)]
⎜ ↳ GaminggearUhidMouse id=16 [slave pointer (2)]
⎜ ↳ GaminggearUhidMultimedia id=17 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Power Button id=7 [slave keyboard (3)]
↳ Sleep Button id=8 [slave keyboard (3)]
↳ ROCCAT ROCCAT Kone EMP System Control id=11 [slave keyboard (3)]
↳ ROCCAT ROCCAT Kone EMP Consumer Control id=15 [slave keyboard (3)]
↳ ROCCAT ROCCAT Kone EMP id=12 [slave keyboard (3)]
↳ ckb1: CORSAIR K68 RGB Mechanical Gaming Keyboard vKB id=13 [slave keyboard (3)]
↳ GaminggearUhidMultimedia id=18 [slave keyboard (3)]
↳ GaminggearUhidKeyboard id=19 [slave keyboard (3)]
Note: the Roccat keyboard listed here is no longer connected and I’m using a corsair keyboard, now. Then use xinput test
to test the id of the key being pressed.
$ xinput test 14
fff ^C
$ xinput test 12 130 ↵
gg ^C
$ xinput test 5 130 ↵
gbgg^C
$ xinput test 13
key release 36
key press 44
jkey release 44
key press 44
jkey release 44
key press 44
jkey release 44
key press 37
key release 37
key press 37
key press 54
^C
As you can see, mine turned out to be the keyboard with id 13
. You can feel free to experiment until you found the correct id
.
You an then use that id
to bind the key press to the custom action.
Hope this helps!
Thx for detailed explenation.
Xinput list gave me this:
[thibaultmol@Quinn ~]$ xinput list ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ Logitech G305 id=8 [slave pointer (2)] ⎜ ↳ SONiX USB DEVICE Consumer Control id=12 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ Power Button id=6 [slave keyboard (3)] ↳ Power Button id=7 [slave keyboard (3)] ↳ 3D Camera: eTronVideo id=9 [slave keyboard (3)] ↳ Eee PC WMI hotkeys id=14 [slave keyboard (3)] ↳ Logitech G305 id=15 [slave keyboard (3)] ↳ SONiX USB DEVICE id=10 [slave keyboard (3)] ↳ SONiX USB DEVICE Keyboard id=11 [slave keyboard (3)] ↳ SONiX USB DEVICE Consumer Control id=13 [slave keyboard (3)] ↳ SONiX USB DEVICE Wireless Radio Control id=16 [slave keyboard (3)]
The correct id is 10, but the windows/start/meta key and the application/menu key both don’t do anything on there either (other keys do register)
OKAY. SO. I figured it out. Turns out, I must have activated SOME keyboard shortcut that caused the windows key to be locked (following the manual, I couldn’t seem to get it unlocked). But factory resetting the keyboard did work. And now the meta key is properly being detected.
Thx for the help anyway @Mirdarthos , now I have atleast learned a neat tool to debug keyboard related things :thum
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.