]> git.proxmox.com Git - mirror_qemu.git/commitdiff
ui/sdl2: pass horizontal scroll information to the device code
authorDmitry Petrov <dpetroff@gmail.com>
Sat, 8 Jan 2022 15:39:46 +0000 (16:39 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Thu, 13 Jan 2022 14:33:18 +0000 (15:33 +0100)
Signed-off-by: Dmitry Petrov <dpetroff@gmail.com>
Message-Id: <20220108153947.171861-5-dpetroff@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ui/sdl2.c

index 0bd30504cfcc6a8b91d9549e630ba9a1a018298b..46a252d7d9d7ea8dfe56a3c972df3c96726c5d5b 100644 (file)
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -33,6 +33,7 @@
 #include "sysemu/runstate-action.h"
 #include "sysemu/sysemu.h"
 #include "ui/win32-kbd-hook.h"
+#include "qemu/log.h"
 
 static int sdl2_num_outputs;
 static struct sdl2_console *sdl2_console;
@@ -535,6 +536,10 @@ static void handle_mousewheel(SDL_Event *ev)
         btn = INPUT_BUTTON_WHEEL_UP;
     } else if (wev->y < 0) {
         btn = INPUT_BUTTON_WHEEL_DOWN;
+    } else if (wev->x < 0) {
+        btn = INPUT_BUTTON_WHEEL_RIGHT;
+    } else if (wev->x > 0) {
+        btn = INPUT_BUTTON_WHEEL_LEFT;
     } else {
         return;
     }