Skip to contentSkip to conversation

input: map INPUT_BUTTON_WHEEL_{UP, DOWN} to legacy input z axis moves.

PATCH New Gerd Hoffmann 1 participant 1 message Mar 10, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 input: map INPUT_BUTTON_WHEEL_{UP, DOWN} to legacy input z axis moves.

Unbreaks mouse wheel.

---
 ui/input-legacy.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
ui/input-legacy.c +14 -0
index f38984b..7dc486b 100644
@@ -359,6 +359,20 @@ static void legacy_mouse_event(DeviceState *dev, QemuConsole *src,
         } else {
             s->buttons &= ~bmap[evt->btn->button];
         }
+        if (evt->btn->down && evt->btn->button == INPUT_BUTTON_WHEEL_UP) {
+            s->qemu_put_mouse_event(s->qemu_put_mouse_event_opaque,
+                                    s->axis[INPUT_AXIS_X],
+                                    s->axis[INPUT_AXIS_Y],
+                                    -1,
+                                    s->buttons);
+        }
+        if (evt->btn->down && evt->btn->button == INPUT_BUTTON_WHEEL_DOWN) {
+            s->qemu_put_mouse_event(s->qemu_put_mouse_event_opaque,
+                                    s->axis[INPUT_AXIS_X],
+                                    s->axis[INPUT_AXIS_Y],
+                                    1,
+                                    s->buttons);
+        }
         break;
     case INPUT_EVENT_KIND_ABS:
         s->axis[evt->abs->axis] = evt->abs->value;
Signature · 1 line
1.8.3.1