Skip to main content
Topic: Key press not detected by showkey or xev, but appears to be detected by kernel (Read 1206 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Key press not detected by showkey or xev, but appears to be detected by kernel

Hi all, recently migrated from Arch to Artix-runit, and I'm loving having a comprehensible init system. Apologies if this is in the wrong section.

My laptop is an Thinkpad X220T, and has two buttons accessible in tablet mode. By default, and before migration, they were mapped to XF86TaskPane and XF86RotateWindows. The button for XF86TaskPane works just fine and is still bound to the script I had for it initially, but the other button inexplicably doesn't work. The script still works fine when called from a terminal and when bound to other keys, so I know that the problem is with the key.

To my understanding, the hwdb files responsible for these keys are provided in the AUR by thinkpad-scripts. It's short, so here it is:
Spoiler (click to show/hide)

XF86TaskPane ("cyclewindows") appears to work as expected. However, XF86RotateWindows doesn't show up in xev, doesn't show up in showkey (scancode or keycode) and produces the following message to dmesg:
Code: [Select]
[  833.968980] atkbd serio0: Unknown key pressed (translated set 2, code 0x6c on isa0060/serio0).
[  833.968987] atkbd serio0: Use 'setkeycodes 6c <keycode>' to make it known.

I have tried the following:
  • setkeycodes 6c 161 (default X keycode for XF86RotateWindows) - not detected by xev or showkey, but atkbd stops complaining.
  • setkeycodes 6c 155 (the other button is keycode 154 in showkey) - showkey as expected. xev reports the key as 163, XF86Mail.
  • setkeycodes 6c 153  - not detected by xev or showkey. atkbd stops complaining.
  • setkeycodes 6c 152  - showkey reports as expected. xev reports the key as 160, XF86ScreenSaver.
  • reinstall thinkpad-scripts - no effect
  • udevadm hwdb --update - no effect
  • rebooting - no effect
  • setkeycodes 6c 38 (decimal keycode for A) - sets it to "L", which is 46, which is 38 in octal. Button works exactly like L key.
  • setkeycodes 6c 241 (161 converted to octal) - no effect

My current workaround is to rebind my rotation script to XF86ScreenSaver, but I would greatly prefer to have my keysyms match up, especially since I'm thinking of using XF86ScreenSaver for another (albeit less important) script. Thanks in advance for any help, I haven't ever had to mess with something as low level as scancodes before.

Re: Key press not detected by showkey or xev, but appears to be detected by kernel

Reply #1
You didn't say if you know the Arch scancodes or if it just worked.
If not, install Arch on a thumb or tell grub to boot the Arch ISO image, reboot and check.
It might be a version issue somewhere in the chain; syncing/debugging across rolling distros is tough.
Linux is fun!  Artix + MX + Puppy + Tinycore + Mint @ home; embedded + Ubuntu + RHEL @ work.
Artix rolling no-systemd + XFCE ISO (thank you!) + MX tweaks + goodies = Heaven!

Re: Key press not detected by showkey or xev, but appears to be detected by kernel

Reply #2
eudev have good support for X200T, but no support for X220T:

cat /usr/lib/udev/hwdb.d/60-keyboard.hwdb
Code: [Select]
# Thinkpad X200_Tablet
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnLENOVO*:pn*:pvrThinkPad*X2*Tablet*
 KEYBOARD_KEY_5d=menu
 KEYBOARD_KEY_63=fn
 KEYBOARD_KEY_66=screenlock
 KEYBOARD_KEY_67=cyclewindows                           # bezel circular arrow
 KEYBOARD_KEY_68=setup                                  # bezel setup / menu
 KEYBOARD_KEY_6c=direction                              # rotate screen
but maybe it's 220x similar
you can try edit   /usr/lib/udev/hwdb.d/60-keyboard.hwdb and add new section and reboot your computer:

Code: [Select]
# Thinkpad X220_Tablet
keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO*:pn*:pvrThinkPadX2[23]0Tablet*
 KEYBOARD_KEY_5d=menu
 KEYBOARD_KEY_63=fn
 KEYBOARD_KEY_66=screenlock
 KEYBOARD_KEY_67=cyclewindows                           # bezel circular arrow
 KEYBOARD_KEY_68=setup                                  # bezel setup / menu
 KEYBOARD_KEY_6c=direction                              # rotate screen driection or scale

 thinkpad-script contain only two actions
https://github.com/martin-ueding/thinkpad-scripts/blob/master/90-X2x0T-keyboard.hwdb

maybe can help that?
but probably contain 90-X2x0T-keyboard.hwdb that maximum.

Please add here your 'dmesg' output