GHOST/SDL: support horizontal scroll events

This commit is contained in:
Campbell Barton
2025-05-14 11:48:41 +00:00
parent 7a013aa9a3
commit 7da0ecccce

View File

@@ -605,8 +605,14 @@ void GHOST_SystemSDL::processEvent(SDL_Event *sdl_event)
GHOST_WindowSDL *window = findGhostWindow(
SDL_GetWindowFromID_fallback(sdl_sub_evt.windowID));
assert(window != nullptr);
g_event = new GHOST_EventWheel(
event_ms, window, GHOST_kEventWheelAxisVertical, sdl_sub_evt.y);
if (sdl_sub_evt.x != 0) {
g_event = new GHOST_EventWheel(
event_ms, window, GHOST_kEventWheelAxisHorizontal, sdl_sub_evt.x);
}
else if (sdl_sub_evt.y != 0) {
g_event = new GHOST_EventWheel(
event_ms, window, GHOST_kEventWheelAxisVertical, sdl_sub_evt.y);
}
break;
}
case SDL_KEYDOWN: