qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 03/10] ui: add support for mice with extra/side butto


From: Gerd Hoffmann
Subject: [Qemu-devel] [PULL 03/10] ui: add support for mice with extra/side buttons
Date: Tue, 31 Jan 2017 14:41:39 +0100

From: Fabian Lesniak <address@hidden>

Adds input event generation for BTN_SIDE and BTN_EXTRA events to gtk and
input-linux methods.

Signed-off-by: Fabian Lesniak <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>
---
 ui/gtk.c         | 4 ++++
 ui/input-linux.c | 6 ++++++
 2 files changed, 10 insertions(+)

diff --git a/ui/gtk.c b/ui/gtk.c
index bdd831c..3f67a34 100644
--- 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;
     }
diff --git a/ui/input-linux.c b/ui/input-linux.c
index f345317..ac31f47 100644
--- a/ui/input-linux.c
+++ b/ui/input-linux.c
@@ -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:
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]