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
struct InputLinux {
const char *evdev;
int fd;
+ bool repeat;
bool grab_request;
bool grab_active;
bool grab_all;
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
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");
},{
.name = "grab-all",
.type = QEMU_OPT_BOOL,
+ },{
+ .name = "repeat",
+ .type = QEMU_OPT_BOOL,
},
{ /* end of list */ }
},