aboutsummaryrefslogtreecommitdiff
path: root/include/hw
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2017-09-26 13:32:43 +0200
committerGerd Hoffmann <kraxel@redhat.com>2017-09-29 10:36:33 +0200
commitf4924974c7c72560f68ab298ac25a525a28a2124 (patch)
tree92829adac0943627d0b39a3ad4333800b9b0a000 /include/hw
parent74083f9c01910b1d36ddaca04db468eb326676ae (diff)
virtio-input: send rel-wheel events for wheel buttons
qemu uses wheel-up/down button events for mouse wheel input, however linux applications typically want REL_WHEEL events. This fixes wheel with linux guests. Tested with X11/wayland, and windows virtio-input driver. Based on a patch from Marc. Added property to enable/disable wheel axis. Cc: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170926113243.26081-1-kraxel@redhat.com
Diffstat (limited to 'include/hw')
-rw-r--r--include/hw/compat.h10
-rw-r--r--include/hw/virtio/virtio-input.h1
2 files changed, 10 insertions, 1 deletions
diff --git a/include/hw/compat.h b/include/hw/compat.h
index 9cc14dd798..cf389b4e85 100644
--- a/include/hw/compat.h
+++ b/include/hw/compat.h
@@ -2,7 +2,15 @@
#define HW_COMPAT_H
#define HW_COMPAT_2_10 \
- /* empty */
+ {\
+ .driver = "virtio-mouse-device",\
+ .property = "wheel-axis",\
+ .value = "false",\
+ },{\
+ .driver = "virtio-tablet-device",\
+ .property = "wheel-axis",\
+ .value = "false",\
+ },
#define HW_COMPAT_2_9 \
{\
diff --git a/include/hw/virtio/virtio-input.h b/include/hw/virtio/virtio-input.h
index 91df57eca4..054c38836f 100644
--- a/include/hw/virtio/virtio-input.h
+++ b/include/hw/virtio/virtio-input.h
@@ -89,6 +89,7 @@ struct VirtIOInputHID {
QemuInputHandler *handler;
QemuInputHandlerState *hs;
int ledstate;
+ bool wheel_axis;
};
struct VirtIOInputHost {