mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-13 15:53:56 +08:00
Input: xen-kbdfront - enable auto repeat for xen keyboard frontend driver
Long pressed key could not show right in XEN vncviewer after tigervnc client changed the way how to send repeat keys, from "Down Up Down Up ..." to "Down Down ... Up". This will report autorepeat to input by checking if same key being pressed, and let handler process it finally. Signed-off-by: Liang Yan <lyan@suse.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
parent
b54bf2fd15
commit
0ca0681002
@ -84,17 +84,20 @@ static void xenkbd_handle_key_event(struct xenkbd_info *info,
|
|||||||
struct xenkbd_key *key)
|
struct xenkbd_key *key)
|
||||||
{
|
{
|
||||||
struct input_dev *dev;
|
struct input_dev *dev;
|
||||||
|
int value = key->pressed;
|
||||||
|
|
||||||
if (test_bit(key->keycode, info->ptr->keybit)) {
|
if (test_bit(key->keycode, info->ptr->keybit)) {
|
||||||
dev = info->ptr;
|
dev = info->ptr;
|
||||||
} else if (test_bit(key->keycode, info->kbd->keybit)) {
|
} else if (test_bit(key->keycode, info->kbd->keybit)) {
|
||||||
dev = info->kbd;
|
dev = info->kbd;
|
||||||
|
if (key->pressed && test_bit(key->keycode, info->kbd->key))
|
||||||
|
value = 2; /* Mark as autorepeat */
|
||||||
} else {
|
} else {
|
||||||
pr_warn("unhandled keycode 0x%x\n", key->keycode);
|
pr_warn("unhandled keycode 0x%x\n", key->keycode);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
input_report_key(dev, key->keycode, key->pressed);
|
input_event(dev, EV_KEY, key->keycode, value);
|
||||||
input_sync(dev);
|
input_sync(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user