summaryrefslogtreecommitdiffstats
path: root/drivers/input/misc/xen-kbdfront.c
diff options
context:
space:
mode:
authorLiang Yan <lyan@suse.com>2017-08-28 09:41:08 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2017-08-28 10:31:31 -0700
commit0ca0681002587d56ebadc16a6c6653028c3c5cbf (patch)
tree0d9832bffbf70c963ea84a0638defe136f0f3193 /drivers/input/misc/xen-kbdfront.c
parentb54bf2fd156c6294eaaac2861939f679f8616b55 (diff)
downloadop-kernel-dev-0ca0681002587d56ebadc16a6c6653028c3c5cbf.zip
op-kernel-dev-0ca0681002587d56ebadc16a6c6653028c3c5cbf.tar.gz
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>
Diffstat (limited to 'drivers/input/misc/xen-kbdfront.c')
-rw-r--r--drivers/input/misc/xen-kbdfront.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/input/misc/xen-kbdfront.c b/drivers/input/misc/xen-kbdfront.c
index fa130e7..6bf56bb 100644
--- a/drivers/input/misc/xen-kbdfront.c
+++ b/drivers/input/misc/xen-kbdfront.c
@@ -84,17 +84,20 @@ static void xenkbd_handle_key_event(struct xenkbd_info *info,
struct xenkbd_key *key)
{
struct input_dev *dev;
+ int value = key->pressed;
if (test_bit(key->keycode, info->ptr->keybit)) {
dev = info->ptr;
} else if (test_bit(key->keycode, info->kbd->keybit)) {
dev = info->kbd;
+ if (key->pressed && test_bit(key->keycode, info->kbd->key))
+ value = 2; /* Mark as autorepeat */
} else {
pr_warn("unhandled keycode 0x%x\n", key->keycode);
return;
}
- input_report_key(dev, key->keycode, key->pressed);
+ input_event(dev, EV_KEY, key->keycode, value);
input_sync(dev);
}
OpenPOWER on IntegriCloud