diff options
-rw-r--r-- | src/sdl/sdl_input.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/sdl/sdl_input.c b/src/sdl/sdl_input.c index 82bb4dfc..070ba600 100644 --- a/src/sdl/sdl_input.c +++ b/src/sdl/sdl_input.c @@ -961,17 +961,17 @@ static void IN_ProcessEvents( void ) case SDL_MOUSEBUTTONDOWN: case SDL_MOUSEBUTTONUP: { - unsigned char b; + int b; switch( e.button.button ) { - case 1: b = K_MOUSE1; break; - case 2: b = K_MOUSE3; break; - case 3: b = K_MOUSE2; break; - case 4: b = K_MWHEELUP; break; - case 5: b = K_MWHEELDOWN; break; - case 6: b = K_MOUSE4; break; - case 7: b = K_MOUSE5; break; - default: b = K_AUX1 + ( e.button.button - 8 ) % 16; break; + case SDL_BUTTON_LEFT: b = K_MOUSE1; break; + case SDL_BUTTON_MIDDLE: b = K_MOUSE3; break; + case SDL_BUTTON_RIGHT: b = K_MOUSE2; break; + case SDL_BUTTON_WHEELUP: b = K_MWHEELUP; break; + case SDL_BUTTON_WHEELDOWN: b = K_MWHEELDOWN; break; + case SDL_BUTTON_X1: b = K_MOUSE4; break; + case SDL_BUTTON_X2: b = K_MOUSE5; break; + default: b = K_AUX1 + ( e.button.button - SDL_BUTTON_X2 + 1 ) % 16; break; } Com_QueueEvent( 0, SE_KEY, b, ( e.type == SDL_MOUSEBUTTONDOWN ? qtrue : qfalse ), 0, NULL ); |