]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
input: map INPUT_BUTTON_WHEEL_{UP,DOWN} to legacy input z axis moves.
authorGerd Hoffmann <kraxel@redhat.com>
Mon, 10 Mar 2014 08:31:01 +0000 (09:31 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 10 Mar 2014 12:49:44 +0000 (13:49 +0100)
Unbreaks mouse wheel.

Reported-by: BALATON Zoltan <balaton@eik.bme.hu>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ui/input-legacy.c

index f38984b1924195ef10e662cda473dcc8b8321ac3..7dc486b8ace9a98ae508fd1dee1d73511e4d022f 100644 (file)
@@ -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;