changeset 4113:82dab719502e SDL-1.2

Fixed bug #464 Added X1/X2 button constants
author Sam Lantinga <slouken@libsdl.org>
date Sat, 29 Dec 2007 06:08:17 +0000
parents 0c3559059d6d
children fc27f3e8eee4
files WhatsNew include/SDL_mouse.h src/video/wincommon/SDL_sysevents.c
diffstat 3 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/WhatsNew	Sat Dec 29 06:06:03 2007 +0000
+++ b/WhatsNew	Sat Dec 29 06:08:17 2007 +0000
@@ -3,6 +3,9 @@
 
 Version 1.0:
 
+1.2.13:
+	Added SDL_BUTTON_X1 and SDL_BUTTON_X2 constants.
+
 1.2.12:
 	Added SDL_VIDEO_ALLOW_SCREENSAVER to override SDL's disabling
 	of the screensaver on Mac OS X and X11.
--- a/include/SDL_mouse.h	Sat Dec 29 06:06:03 2007 +0000
+++ b/include/SDL_mouse.h	Sat Dec 29 06:08:17 2007 +0000
@@ -122,9 +122,13 @@
 #define SDL_BUTTON_RIGHT	3
 #define SDL_BUTTON_WHEELUP	4
 #define SDL_BUTTON_WHEELDOWN	5
+#define SDL_BUTTON_X1		6
+#define SDL_BUTTON_X2		7
 #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/wincommon/SDL_sysevents.c	Sat Dec 29 06:06:03 2007 +0000
+++ b/src/video/wincommon/SDL_sysevents.c	Sat Dec 29 06:08:17 2007 +0000
@@ -520,12 +520,12 @@
 						break;
 					case WM_XBUTTONDOWN:
 						xbuttonval = GET_XBUTTON_WPARAM(wParam);
-						button = SDL_BUTTON_WHEELDOWN + xbuttonval;
+						button = SDL_BUTTON_X1 + xbuttonval - 1;
 						state = SDL_PRESSED;
 						break;
 					case WM_XBUTTONUP:
 						xbuttonval = GET_XBUTTON_WPARAM(wParam);
-						button = SDL_BUTTON_WHEELDOWN + xbuttonval;
+						button = SDL_BUTTON_X1 + xbuttonval - 1;
 						state = SDL_RELEASED;
 						break;
 					default: