virtio-input: send rel-wheel events for wheel buttons
PATCH v2 1/1 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 <[email protected]>
Signed-off-by Gerd Hoffmann <[email protected]>
--- include/hw/compat.h | 10 +++- include/hw/virtio/virtio-input.h | 1 + hw/input/virtio-input-hid.c | 119 +++++++++++++++++++++++++++++++++++++-- 3 files changed, 124 insertions(+), 6 deletions(-)
include/hw/compat.h +9 -1
@@ -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 \ {\
include/hw/virtio/virtio-input.h +1 -0
@@ -89,6 +89,7 @@ struct VirtIOInputHID {QemuInputHandler *handler;QemuInputHandlerState *hs;int ledstate; +bool wheel_axis; };struct VirtIOInputHost {
hw/input/virtio-input-hid.c +114 -5
179 lines not on this page · raw message
Signature · 1 line
2.9.3