[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Understanding the ThinkPad W550s keyboard



On Sun, 1 Dec 2019 23:33:10 -0300
Henrique de Moraes Holschuh <hmh@debian.org> wrote:

Thanks for the help (and for your work on the thinkpad-acpi driver).

> On Sun, 01 Dec 2019, Celejar wrote:
> > 1) Most of the function keys don't seem to have scancodes / keycodes
> > (evtest doesn't react in any way to their press / release). Is this a
> > hardware thing - they just aren't designed as keyboard keys - or a
> > failure of the kernel? Some of the ones that have no keycodes do work,
> > however (F5-7). Is this happening through the BIOS or something at a
> > lower level than the kernel?
> 
> The thinkpad-acpi exports a fully reconfigurable input device.  *If* it
> gets the keycode from the thinkpad firmware, it can map it to any EV_KEY
> event.  Refer to its documentation (and to udev's) for details.

I tried reading through
Documentation/admin-guide/laptops/thinkpad-acpi.rst.gz

It's a little over my head, and also apparently somewhat outdated
(e.g., the table that describes what the Fn keys do on IBM and Lenovo
machines does not at all match what the keys do on the W550s). I gather
that for the keys that aren't showing anything at all under evtest, the
firmware isn't sending anything to the driver? Or is it doing something
via the acpi system that doesn't show up under evtest? I don't really
understand the details of acpi and how it interacts with the keyboard.

> Maybe someone wrote a GUI thing to remap input device events.  If such a
> thing exists, you can use it.

I'm happy to use the CLI or a configuration file, as long as they're
documented clearly in a way that a layman (as opposed to a kernel
hacker or udev expert) can understand ;)
 
> > 2) How do the function keys that are supposed to do stuff in Windows
> > work? If they don't send scancodes, how do they communicate with the
> > operating system, and how can they be used under Linux?
> 
> In windows, a Lenovo driver hooks to ACPI and WMI and does whatever is
> needed.  Thinkpad-acpi can handle the ACPI events.  No idea about WMI
> ones.
> 
> > 3) Why doesn't F4 do anything (the microphone continues to work
> > regardless of my pressing F4)?
> 
> Because you need to mess with the HDA mixer for that to work, I think.
> If there *is* an ACPI fuction to change a gate that the standard audio
> subsystem cannot mess with, thinkpad-acpi alone might be able to do
> something about it.
> 
> But if you need to mess with the HDA mixer, you need a cross-subsystem
> callback layer to let something inside the kernel order ALSA to mute the
> mic and not let anything else unmute it.  I don't think this exists
> [yet].  So, it boils down to: thinkpad-acpi could generate an input
> event, and something in userspace would have to handle it and mute the
> mic through alsa.
> 
> You could reprogram the thinkpad-acpi input device to issue MIC_MUTE and
> see if that gets handled by something in your desktop environment...

I get the bottom line, if not quite all the details. That seems to be
how F1 (speaker mute) is working here: MUTE is issued, and XFCE ties
that to "amixer set Master toggle".

Thanks again for the help.

Celejar


Reply to: