From 07e03237715316b3d7b84b312bccb1686f1443c9 Mon Sep 17 00:00:00 2001 From: Robert Cochran Date: Thu, 14 Feb 2019 13:13:44 -0800 Subject: [PATCH] Add handling of left and right mousewheel events to the SDL2 input path --- src/posix/sdl/i_input.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/posix/sdl/i_input.cpp b/src/posix/sdl/i_input.cpp index 61a1fe0be..0d45ed722 100644 --- a/src/posix/sdl/i_input.cpp +++ b/src/posix/sdl/i_input.cpp @@ -378,7 +378,12 @@ void MessagePump (const SDL_Event &sev) else { event.type = EV_KeyDown; - event.data1 = sev.wheel.y > 0 ? KEY_MWHEELUP : KEY_MWHEELDOWN; + + if (sev.wheel.y != 0) + event.data1 = sev.wheel.y > 0 ? KEY_MWHEELUP : KEY_MWHEELDOWN; + else + event.data1 = sev.wheel.x > 0 ? KEY_MWHEELRIGHT : KEY_MWHEELLEFT; + D_PostEvent (&event); event.type = EV_KeyUp; D_PostEvent (&event);