From 3b419e9d046cf34aac8b971621cd443fed8b021d Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Wed, 21 Aug 2019 03:18:23 +0000 Subject: [PATCH] Fix mouse buttons 4 and 5 on Linux with SDL2, at least for 2.0.9 and up git-svn-id: https://svn.eduke32.com/eduke32@8043 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/src/sdlayer.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/build/src/sdlayer.cpp b/source/build/src/sdlayer.cpp index d1f1acf32..41ca3c728 100644 --- a/source/build/src/sdlayer.cpp +++ b/source/build/src/sdlayer.cpp @@ -2060,13 +2060,14 @@ int32_t handleevents_sdlcommon(SDL_Event *ev) break; #endif /* Thumb buttons. */ -#if SDL_MAJOR_VERSION==1 || !defined _WIN32 +#if SDL_MAJOR_VERSION==1 // NOTE: SDL1 does have SDL_BUTTON_X1, but that's not what is - // generated. Neither with SDL2 on Linux. (Other OSs: not tested.) + // generated. (Only tested on Linux and Windows.) case 8: j = 3; break; case 9: j = 6; break; #else - // On SDL2/Windows, everything is as it should be. + // On SDL2/Windows and SDL >= 2.0.?/Linux, everything is as it should be. + // If anyone cares about old versions of SDL2 on Linux, patches welcome. case SDL_BUTTON_X1: j = 3; break; case SDL_BUTTON_X2: j = 6; break; #endif