Thinkpad keyboard - XF86 special keys

Good morning! I am new here, having just gone through the process of switching my laptop (Thinkpad X270) over to NixOS from Guix, via Debian.
I have a working configuration up and running, and now I am going through the process of sorting out the small issues. Currently I have an issue with the volume up and down buttons on the keyboard (accessed via the function keys). When I run xev, these keys do not return the XF86 codes I would expect. Other functions are working (such as brightness up/down), so I am not sure how to debug this.

  • I have enabled libinput, but I see that under /etc/X11/xorg.conf.d there is a 20-evdev.conf file as well as 40-libinput.conf. Is this as expected? I understood libinput replaces evdev, but I am not sure if it adds a layer on top.
  • Does anyone else have a Lenovo X270 (or similar), and has these keys working? If so, I would appreciate your hints!

I’m loving NixOS - I have managed to get a configuration up and running quickly (although my guix experience helped with the concepts). Once I am happy with the laptop, I might be giving NixOS a run on my desktop and home server. Thanks to you all for the development so far.

Looks like I can’t edit or delete the original message - probably because I don’t have enough “trust” here yet.

I have narrowed the problem down. It is nothing to do with the evdev/libinput I explained in the original post. In fact it appears to be something related to my bspwm configuration. If I switch to xfce the correct keycodes are reported in xev, and the functions work as expected. I now need to understand why.

Your comments or pointers would be welcome.

1 Like

Ok - this issue is now solved, or rather I now understand what is happening. Having configured sxhkd to utilise the media keys, these key presses are removed before the input stream reaches xev. Therefore I wasn’t seeing the keycodes when I expected them. I hadn’t configured any volume control in xfce, so of course the keycodes were visible in xev.

I hereby declare myself an idiot! Hopefully this thread will help someone else in the future if they come across the same issue.