• A
    Input: adbhid - produce all CapsLock key events · 9a402b64
    Andrew McNabb 提交于
    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: NAndrew McNabb <amcnabb@mcnabbs.org>
    Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
    9a402b64
adbhid.c 33.5 KB