From: Karl Dahlke I think there is general agreement, including myself, that led state should be part of the key event, like shiftstate, and not grabbed asynchronously after the fact. Cc: Dmitry Torokhov Cc: Jiri Kosina Signed-off-by: Andrew Morton --- drivers/char/keyboard.c | 1 + include/linux/keyboard.h | 1 + 2 files changed, 2 insertions(+) diff -puN drivers/char/keyboard.c~input-put-ledstate-in-the-keyboard-notifier drivers/char/keyboard.c --- a/drivers/char/keyboard.c~input-put-ledstate-in-the-keyboard-notifier +++ a/drivers/char/keyboard.c @@ -1238,6 +1238,7 @@ static void kbd_keycode(unsigned int key } param.shift = shift_final = (shift_state | kbd->slockstate) ^ kbd->lockstate; + param.ledstate = getledstate(); key_map = key_maps[shift_final]; if (atomic_notifier_call_chain(&keyboard_notifier_list, KBD_KEYCODE, ¶m) == NOTIFY_STOP || !key_map) { diff -puN include/linux/keyboard.h~input-put-ledstate-in-the-keyboard-notifier include/linux/keyboard.h --- a/include/linux/keyboard.h~input-put-ledstate-in-the-keyboard-notifier +++ a/include/linux/keyboard.h @@ -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 */ }; _