From 4bf6c306ab568bb912a9918aec238b9a0820b310 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 4 Nov 2019 01:07:34 +0100 Subject: [PATCH] - added handling for cleariung mouse wheel events --- source/build/src/sdlayer.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/source/build/src/sdlayer.cpp b/source/build/src/sdlayer.cpp index 8b6305af0..4948bb273 100644 --- a/source/build/src/sdlayer.cpp +++ b/source/build/src/sdlayer.cpp @@ -2064,10 +2064,20 @@ int32_t handleevents_pollsdl(void) int32_t handleevents(void) { int32_t rv; - - if (inputchecked && g_mouseEnabled) - { - g_mouseBits &= ~(16 | 32); + + if (inputchecked && g_mouseEnabled) + { + // This is a horrible crutch + if (inputState.mouseReadButtons() & WHEELUP_MOUSE) + { + event_t ev = { EV_KeyUp, 0, (int16_t)KEY_MWHEELUP }; + D_PostEvent(&ev); + } + if (inputState.mouseReadButtons() & WHEELDOWN_MOUSE) + { + event_t ev = { EV_KeyUp, 0, (int16_t)KEY_MWHEELDOWN }; + D_PostEvent(&ev); + } } rv = handleevents_pollsdl();