Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: put ledstate in the keyboard notifier

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>

authored by

Karl Dahlke and committed by
Dmitry Torokhov
0beb4f6f 76d057ce

+3
+2
drivers/char/keyboard.c
··· 1237 1237 } 1238 1238 1239 1239 param.shift = shift_final = (shift_state | kbd->slockstate) ^ kbd->lockstate; 1240 + param.ledstate = kbd->ledflagstate; 1240 1241 key_map = key_maps[shift_final]; 1241 1242 1242 1243 if (atomic_notifier_call_chain(&keyboard_notifier_list, KBD_KEYCODE, &param) == NOTIFY_STOP || !key_map) { ··· 1286 1285 1287 1286 (*k_handler[type])(vc, keysym & 0xff, !down); 1288 1287 1288 + param.ledstate = kbd->ledflagstate; 1289 1289 atomic_notifier_call_chain(&keyboard_notifier_list, KBD_POST_KEYSYM, &param); 1290 1290 1291 1291 if (type != KT_SLOCK)
+1
include/linux/keyboard.h
··· 33 33 struct vc_data *vc; /* VC on which the keyboard press was done */ 34 34 int down; /* Pressure of the key? */ 35 35 int shift; /* Current shift mask */ 36 + int ledstate; /* Current led state */ 36 37 unsigned int value; /* keycode, unicode value or keysym */ 37 38 }; 38 39