Skip to content

Commit

Permalink
ui/sdl2: pass horizontal scroll information to the device code
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Petrov <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
  • Loading branch information
can3p authored and kraxel committed Jan 13, 2022
1 parent 13cb360 commit ed80f50
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ui/sdl2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit ed80f50

Please sign in to comment.