Skip to content

Commit

Permalink
Input: put ledstate in the keyboard notifier
Browse files Browse the repository at this point in the history
Led state should be part of the key event, like shiftstate, and not
grabbed asynchronously after the fact.

[samuel.thibault@ens-lyon.org: various fixes]

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Karl Dahlke authored and Dmitry Torokhov committed Apr 15, 2008
1 parent 76d057c commit 0beb4f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/char/keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -1237,6 +1237,7 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw)
}

param.shift = shift_final = (shift_state | kbd->slockstate) ^ kbd->lockstate;
param.ledstate = kbd->ledflagstate;
key_map = key_maps[shift_final];

if (atomic_notifier_call_chain(&keyboard_notifier_list, KBD_KEYCODE, &param) == NOTIFY_STOP || !key_map) {
Expand Down Expand Up @@ -1285,6 +1286,7 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw)

(*k_handler[type])(vc, keysym & 0xff, !down);

param.ledstate = kbd->ledflagstate;
atomic_notifier_call_chain(&keyboard_notifier_list, KBD_POST_KEYSYM, &param);

if (type != KT_SLOCK)
Expand Down
1 change: 1 addition & 0 deletions include/linux/keyboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ struct keyboard_notifier_param {
struct vc_data *vc; /* VC on which the keyboard press was done */
int down; /* Pressure of the key? */
int shift; /* Current shift mask */
int ledstate; /* Current led state */
unsigned int value; /* keycode, unicode value or keysym */
};

Expand Down

0 comments on commit 0beb4f6

Please sign in to comment.