diff options
author | Dmitry Torokhov <dtor@insightbb.com> | 2006-09-10 21:56:06 -0400 |
---|---|---|
committer | Dmitry Torokhov <dtor@insightbb.com> | 2006-09-10 21:56:06 -0400 |
commit | 6d2750c167d47a97936cf4415165205f945c08f8 (patch) | |
tree | 9f07d5e0fe6c3145f250b36e789e367cdca73e75 /drivers | |
parent | e38de678f6b19be3e46a678ec4deeaa7fa0fc140 (diff) | |
download | op-kernel-dev-6d2750c167d47a97936cf4415165205f945c08f8.zip op-kernel-dev-6d2750c167d47a97936cf4415165205f945c08f8.tar.gz |
Input: send key up events at disconnect
Emit key up events for all pressed keys/buttons when disconnecting
an input device. Cures "stuck" enter key effect when unloading
keyboard module.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/input/input.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c index 1fc0517..1c71dd6 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -1014,9 +1014,12 @@ EXPORT_SYMBOL(input_register_device); void input_unregister_device(struct input_dev *dev) { struct list_head *node, *next; + int code; - if (!dev) - return; + for (code = 0; code <= KEY_MAX; code++) + if (test_bit(code, dev->key)) + input_report_key(dev, code, 0); + input_sync(dev); del_timer_sync(&dev->timer); |