ui: add support for mice with extra/side buttons
authorFabian Lesniak <fabian@lesniak-it.de>
Tue, 6 Dec 2016 19:00:07 +0000 (20:00 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 31 Jan 2017 07:14:51 +0000 (08:14 +0100)
Adds input event generation for BTN_SIDE and BTN_EXTRA events to gtk and
input-linux methods.

Signed-off-by: Fabian Lesniak <fabian@lesniak-it.de>
Message-id: 20161206190007.7539-4-fabian@lesniak-it.de
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ui/gtk.c
ui/input-linux.c

index bdd831c268163d7df01ee959865d3245b72aecee..3f67a345d1eaa9c33192f241102f27cad756d9fc 100644 (file)
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -1007,6 +1007,10 @@ static gboolean gd_button_event(GtkWidget *widget, GdkEventButton *button,
         btn = INPUT_BUTTON_MIDDLE;
     } else if (button->button == 3) {
         btn = INPUT_BUTTON_RIGHT;
+    } else if (button->button == 8) {
+        btn = INPUT_BUTTON_SIDE;
+    } else if (button->button == 9) {
+        btn = INPUT_BUTTON_EXTRA;
     } else {
         return TRUE;
     }
index f345317794850c1675b1a708ac8f6f7f95ece1c0..ac31f47719603e390bf48c7038dbd23b2c420335 100644 (file)
@@ -291,6 +291,12 @@ static void input_linux_handle_mouse(InputLinux *il, struct input_event *event)
             qemu_input_queue_btn(NULL, INPUT_BUTTON_WHEEL_DOWN,
                                  event->value);
             break;
+        case BTN_SIDE:
+            qemu_input_queue_btn(NULL, INPUT_BUTTON_SIDE, event->value);
+            break;
+        case BTN_EXTRA:
+            qemu_input_queue_btn(NULL, INPUT_BUTTON_EXTRA, event->value);
+            break;
         };
         break;
     case EV_REL: