patch-2.4.25 linux-2.4.25/drivers/input/keybdev.c
Next file: linux-2.4.25/drivers/input/uinput.c
Previous file: linux-2.4.25/drivers/input/Makefile
Back to the patch index
Back to the overall index
- Lines: 35
- Date:
2004-02-18 05:36:31.000000000 -0800
- Orig file:
linux-2.4.24/drivers/input/keybdev.c
- Orig date:
2003-08-25 04:44:42.000000000 -0700
diff -urN linux-2.4.24/drivers/input/keybdev.c linux-2.4.25/drivers/input/keybdev.c
@@ -154,16 +154,18 @@
static struct input_handler keybdev_handler;
+static unsigned int ledstate = 0xff;
+
void keybdev_ledfunc(unsigned int led)
{
struct input_handle *handle;
- for (handle = keybdev_handler.handle; handle; handle = handle->hnext) {
+ ledstate = led;
+ for (handle = keybdev_handler.handle; handle; handle = handle->hnext) {
input_event(handle->dev, EV_LED, LED_SCROLLL, !!(led & 0x01));
input_event(handle->dev, EV_LED, LED_NUML, !!(led & 0x02));
input_event(handle->dev, EV_LED, LED_CAPSL, !!(led & 0x04));
-
}
}
@@ -202,7 +204,12 @@
input_open_device(handle);
// printk(KERN_INFO "keybdev.c: Adding keyboard: input%d\n", dev->number);
- kbd_refresh_leds();
+
+ if (ledstate != 0xff) {
+ input_event(dev, EV_LED, LED_SCROLLL, !!(ledstate & 0x01));
+ input_event(dev, EV_LED, LED_NUML, !!(ledstate & 0x02));
+ input_event(dev, EV_LED, LED_CAPSL, !!(ledstate & 0x04));
+ }
return handle;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)