qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] hw/display/xenfb: Simulate auto-repeat key events
@ 2017-11-02 17:18 Liang Yan
  2017-11-02 17:26 ` Peter Maydell
  0 siblings, 1 reply; 6+ messages in thread
From: Liang Yan @ 2017-11-02 17:18 UTC (permalink / raw)
  To: sstabellini, anthony.perard, xen-devel, qemu-devel; +Cc: qemu-trivial

New tigervnc changes the way to send long pressed key,
from "down up down up ..." to "down down ... up", it only
affects xen pv console mode. I send a patch to latest
kernel side, but it may have a fix in qemu backend for
back compatible becase guest VMs may use very old kernel.
This patch inserts an up event after each regular key down
event to simulate an auto-repeat key event for xen keyboard
frontend driver.

Signed-off-by: Liang Yan <lyan@suse.com>
---
v2:
- exclude extended key
- change log comment

 hw/display/xenfb.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index 8e2547ac05..1bc5b41ab7 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -292,6 +292,11 @@ static void xenfb_key_event(void *opaque, int scancode)
     }
     trace_xenfb_key_event(opaque, scancode2linux[scancode], down);
     xenfb_send_key(xenfb, down, scancode2linux[scancode]);
+
+    /* insert an up event for regular down key event */
+    if (down && !xenfb->extended) {
+        xenfb_send_key(xenfb, 0, scancode2linux[scancode]);
+    }
 }
 
 /*
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-11-03  1:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-02 17:18 [Qemu-devel] [PATCH v2] hw/display/xenfb: Simulate auto-repeat key events Liang Yan
2017-11-02 17:26 ` Peter Maydell
2017-11-02 17:40   ` Daniel P. Berrange
2017-11-02 18:09     ` Liang Yan
2017-11-03  1:12     ` Liang Yan
2017-11-02 17:56   ` Liang Yan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).