[ltp] thinkpad-acpi and input layer events

Shem Multinymous linux-thinkpad@linux-thinkpad.org
Wed, 1 Aug 2007 11:29:27 -0400


On 8/1/07, Henrique de Moraes Holschuh <hmh@hmh.eng.br> wrote:
> On Wed, 01 Aug 2007, Igor V. Rafienko wrote:
> > Previously, a lot of hotkey presses generated ACPI events. This was all
> > nice and dandy and I had my acpid execute certain things upon receiving
> > these events. Latest thinkpad-acpi provides a choice: setting
> > THINKPAD_ACPI_INPUT_ENABLED gives one input layer events, rather than ACPI
> > events.
>
> Actually, it still gives you both, but it maps the input layer keys by
> default, so you get those events instead of acpi ones.
>
> You can use input-kbd to map everything to KEY_UNKNOWN or KEY_RESERVED, and
> that will cause all usual ACPI events to be generated, as documented.

It seems that only Debian and its derivatives have an input-utils
package with the input-kbd binary. SuSE and Mandrake have
"input-utils" RPMs that contain different stuff (BTW, their "evtest"
is nicer than "input-events"), and AFAICT Fedora has none.

So here's how I restored the Fn-F3 ACPI event under Fedora:

$ svn co svn://svn.debian.org/svn/collab-maint/ext-maint/input-utils/trunk
input-utils
$ cd input-utils
$ make
# ./input-kbd 5    # manually verify that "5" is the correct event device
# echo '0x0002 = KEY_UNKNOWN' | ./input-kbd -f /dev/stdin 5

And to handle *all* hotkeys via ACPI:
# ./input-kbd 5 | perl -pe 's/ = .*/ = KEY_RESERVED/' | ./input-kbd -f
/dev/stdin 5


> > I am wondering how I can make my thinkpad respond to the events from the
> > input layer. That is, with ACPI events, I had a few scripts set up in
>
> HAL is the easiest way.  You need a very, very new one, though.

Configuration examples would not go unappreciated.


> You can
> probably get new enough X.org with the event-based keyboard driver to
> respond to the keys without hassle even without HAL,

If handled through X, hotkeys like Fn-F4 won't work in textmode or
other user accounts.

  Shem