# HG changeset patch # User Sam Lantinga # Date 1198908565 0 # Node ID 545fbf461c5be8f54d35a34d7fdd62a95bc47c99 # Parent 546f7c1eb75587ca751e412fcc8088960981cd72 Fixed bug #464 Added X1/X2 button constants diff -r 546f7c1eb755 -r 545fbf461c5b include/SDL_mouse.h --- a/include/SDL_mouse.h Sat Dec 29 03:25:11 2007 +0000 +++ b/include/SDL_mouse.h Sat Dec 29 06:09:25 2007 +0000 @@ -207,9 +207,13 @@ #define SDL_BUTTON_LEFT 1 #define SDL_BUTTON_MIDDLE 2 #define SDL_BUTTON_RIGHT 3 +#define SDL_BUTTON_X1 4 +#define SDL_BUTTON_X2 5 #define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT) #define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE) #define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT) +#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1) +#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2) /* Ends C function definitions when using C++ */ diff -r 546f7c1eb755 -r 545fbf461c5b src/video/win32/SDL_win32events.c --- a/src/video/win32/SDL_win32events.c Sat Dec 29 03:25:11 2007 +0000 +++ b/src/video/win32/SDL_win32events.c Sat Dec 29 06:09:25 2007 +0000 @@ -590,12 +590,12 @@ break; case WM_XBUTTONDOWN: xbuttonval = GET_XBUTTON_WPARAM(wParam); - button = SDL_BUTTON_RIGHT + xbuttonval; + button = SDL_BUTTON_X1 + xbuttonval - 1; state = SDL_PRESSED; break; case WM_XBUTTONUP: xbuttonval = GET_XBUTTON_WPARAM(wParam); - button = SDL_BUTTON_RIGHT + xbuttonval; + button = SDL_BUTTON_X1 + xbuttonval - 1; state = SDL_RELEASED; break; default: