Fixed bug #464
authorSam Lantinga <slouken@libsdl.org>
Sat, 29 Dec 2007 06:09:25 +0000
changeset 2284 545fbf461c5b
parent 2283 546f7c1eb755
child 2285 a5de28552be4
Fixed bug #464 Added X1/X2 button constants
include/SDL_mouse.h
src/video/win32/SDL_win32events.c
--- 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++ */
--- 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: