From 8fa92bf20683add4eb25ba122844a5e5d8c65eb8 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 2 Jul 2012 16:49:23 +0900 Subject: [PATCH] Add 32 button support to sdl and win as well. The world isn't x11 (much as I'd like it to be) --- libs/video/targets/in_sdl.c | 6 +++--- libs/video/targets/in_win.c | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libs/video/targets/in_sdl.c b/libs/video/targets/in_sdl.c index 9c1a8eec2..61e0ebc51 100644 --- a/libs/video/targets/in_sdl.c +++ b/libs/video/targets/in_sdl.c @@ -530,15 +530,15 @@ IN_LL_ProcessEvents (void) case SDL_MOUSEBUTTONDOWN: case SDL_MOUSEBUTTONUP: but = event.button.button; + if ((unsigned) but > 32) + break; if (but == 2) but = 3; else if (but == 3) but = 2; switch (but) { - case 1: - case 2: - case 3: + default: Key_Event (QFM_BUTTON1 + but - 1, 0, event.type == SDL_MOUSEBUTTONDOWN); break; diff --git a/libs/video/targets/in_win.c b/libs/video/targets/in_win.c index 8c95d4edf..2a14d7179 100644 --- a/libs/video/targets/in_win.c +++ b/libs/video/targets/in_win.c @@ -59,9 +59,9 @@ extern qboolean win_canalttab; extern DEVMODE win_gdevmode; // mouse local variables -static unsigned int uiWheelMessage; -static int mouse_buttons; -static int mouse_oldbuttonstate; +static unsigned uiWheelMessage; +static unsigned mouse_buttons; +static unsigned mouse_oldbuttonstate; static POINT current_pos; static float mx_accum, my_accum; static qboolean mouseinitialized; @@ -317,7 +317,7 @@ IN_StartupMouse (void) } } - mouse_buttons = 3; + mouse_buttons = 32; // if a fullscreen video mode was set before the mouse was initialized, // set the mouse state appropriately @@ -383,7 +383,7 @@ IN_LL_Shutdown (void) } static void -IN_MouseEvent (int mstate) +IN_MouseEvent (unsigned mstate) { int i;