qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PULL 4/5] input-linux: add switch to enable auto-repeat events
Date: Wed,  9 Mar 2016 10:04:36 +0100	[thread overview]
Message-ID: <1457514277-32408-5-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1457514277-32408-1-git-send-email-kraxel@redhat.com>

Enable with "-input-linux /dev/input/${device},repeat=on".

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 1457087116-4379-4-git-send-email-kraxel@redhat.com
---
 ui/input-linux.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/ui/input-linux.c b/ui/input-linux.c
index ad43963..0bc0405 100644
--- a/ui/input-linux.c
+++ b/ui/input-linux.c
@@ -132,6 +132,7 @@ typedef struct InputLinux InputLinux;
 struct InputLinux {
     const char  *evdev;
     int         fd;
+    bool        repeat;
     bool        grab_request;
     bool        grab_active;
     bool        grab_all;
@@ -188,7 +189,7 @@ static void input_linux_event_keyboard(void *opaque)
 
         switch (event.type) {
         case EV_KEY:
-            if (event.value > 1) {
+            if (event.value > 2 || (event.value > 1 && !il->repeat)) {
                 /*
                  * ignore autorepeat + unknown key events
                  * 0 == up, 1 == down, 2 == autorepeat, other == undefined
@@ -316,6 +317,7 @@ int input_linux_init(void *opaque, QemuOpts *opts, Error **errp)
 
     il->evdev = qemu_opt_get(opts, "evdev");
     il->grab_all = qemu_opt_get_bool(opts, "grab-all", false);
+    il->repeat = qemu_opt_get_bool(opts, "repeat", false);
 
     if (!il->evdev) {
         error_setg(errp, "no input device specified");
@@ -374,6 +376,9 @@ static QemuOptsList qemu_input_linux_opts = {
         },{
             .name = "grab-all",
             .type = QEMU_OPT_BOOL,
+        },{
+            .name = "repeat",
+            .type = QEMU_OPT_BOOL,
         },
         { /* end of list */ }
     },
-- 
1.8.3.1

  parent reply	other threads:[~2016-03-09  9:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-09  9:04 [Qemu-devel] [PULL 0/5] ui: add linux evdev support, vnc and console fixes Gerd Hoffmann
2016-03-09  9:04 ` [Qemu-devel] [PULL 1/5] vnc: send cursor when a new client is connecting Gerd Hoffmann
2016-03-09  9:04 ` [Qemu-devel] [PULL 2/5] input: linux evdev support Gerd Hoffmann
2016-03-09  9:04 ` [Qemu-devel] [PULL 3/5] input-linux: add option to toggle grab on all devices Gerd Hoffmann
2016-03-09  9:04 ` Gerd Hoffmann [this message]
2016-03-09  9:04 ` [Qemu-devel] [PULL 5/5] ui/console: add escape sequence \e[5, 6n Gerd Hoffmann
2016-03-10  5:00 ` [Qemu-devel] [PULL 0/5] ui: add linux evdev support, vnc and console fixes Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1457514277-32408-5-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).