changeset 2284:545fbf461c5b

Fixed bug #464 Added X1/X2 button constants
author Sam Lantinga <slouken@libsdl.org>
date Sat, 29 Dec 2007 06:09:25 +0000
parents 546f7c1eb755
children a5de28552be4
files include/SDL_mouse.h src/video/win32/SDL_win32events.c
diffstat 2 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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: