Skip to content
Commit 9a402b64 authored by Andrew McNabb's avatar Andrew McNabb Committed by Dmitry Torokhov
Browse files

Input: adbhid - produce all CapsLock key events



The ADB keyboard, which is used for Apple PowerBooks, has strange behavior
with regard to the capslock key.  It keeps track of capslock state
internally, and it sends a keycode when capslock is engaged and a keycode
when capslock is disengaged.

When the current adbhid driver sees that the capslock key is pressed or
released, it creates both a keypress event and a keyrelease event
simultaneously.  This results in normal capslock behavior.

While this works, it makes it impossible to remap the capslock key to be a
control key.  However, by translating the 0xff keycode into capslock
keycodes, we can restore the missing capslock events and make it possible
to remap the capslock key.

With this patch, the adbhid driver will translate these 0xff keycodes into
capslock keypresses and keyreleases if
/sys/module/adbhid/parameters/restore_capslock_events is set to 1.
Otherwise it will retain the current behavior.  This option is off by
default because occasionally the 0xff keycode is not a capslock event, and
a mistake may require the user to tap the capslock key.

[akpm@linux-foundation.org: cleanups]
Signed-off-by: default avatarAndrew McNabb <amcnabb@mcnabbs.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent f493018e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment