Fixed bug #464 SDL-1.2
authorSam Lantinga <slouken@libsdl.org>
Sat, 29 Dec 2007 06:08:17 +0000
branchSDL-1.2
changeset 411382dab719502e
parent 4112 0c3559059d6d
child 4114 fc27f3e8eee4
Fixed bug #464
Added X1/X2 button constants
WhatsNew
include/SDL_mouse.h
src/video/wincommon/SDL_sysevents.c
     1.1 --- a/WhatsNew	Sat Dec 29 06:06:03 2007 +0000
     1.2 +++ b/WhatsNew	Sat Dec 29 06:08:17 2007 +0000
     1.3 @@ -3,6 +3,9 @@
     1.4  
     1.5  Version 1.0:
     1.6  
     1.7 +1.2.13:
     1.8 +	Added SDL_BUTTON_X1 and SDL_BUTTON_X2 constants.
     1.9 +
    1.10  1.2.12:
    1.11  	Added SDL_VIDEO_ALLOW_SCREENSAVER to override SDL's disabling
    1.12  	of the screensaver on Mac OS X and X11.
     2.1 --- a/include/SDL_mouse.h	Sat Dec 29 06:06:03 2007 +0000
     2.2 +++ b/include/SDL_mouse.h	Sat Dec 29 06:08:17 2007 +0000
     2.3 @@ -122,9 +122,13 @@
     2.4  #define SDL_BUTTON_RIGHT	3
     2.5  #define SDL_BUTTON_WHEELUP	4
     2.6  #define SDL_BUTTON_WHEELDOWN	5
     2.7 +#define SDL_BUTTON_X1		6
     2.8 +#define SDL_BUTTON_X2		7
     2.9  #define SDL_BUTTON_LMASK	SDL_BUTTON(SDL_BUTTON_LEFT)
    2.10  #define SDL_BUTTON_MMASK	SDL_BUTTON(SDL_BUTTON_MIDDLE)
    2.11  #define SDL_BUTTON_RMASK	SDL_BUTTON(SDL_BUTTON_RIGHT)
    2.12 +#define SDL_BUTTON_X1MASK	SDL_BUTTON(SDL_BUTTON_X1)
    2.13 +#define SDL_BUTTON_X2MASK	SDL_BUTTON(SDL_BUTTON_X2)
    2.14  
    2.15  
    2.16  /* Ends C function definitions when using C++ */
     3.1 --- a/src/video/wincommon/SDL_sysevents.c	Sat Dec 29 06:06:03 2007 +0000
     3.2 +++ b/src/video/wincommon/SDL_sysevents.c	Sat Dec 29 06:08:17 2007 +0000
     3.3 @@ -520,12 +520,12 @@
     3.4  						break;
     3.5  					case WM_XBUTTONDOWN:
     3.6  						xbuttonval = GET_XBUTTON_WPARAM(wParam);
     3.7 -						button = SDL_BUTTON_WHEELDOWN + xbuttonval;
     3.8 +						button = SDL_BUTTON_X1 + xbuttonval - 1;
     3.9  						state = SDL_PRESSED;
    3.10  						break;
    3.11  					case WM_XBUTTONUP:
    3.12  						xbuttonval = GET_XBUTTON_WPARAM(wParam);
    3.13 -						button = SDL_BUTTON_WHEELDOWN + xbuttonval;
    3.14 +						button = SDL_BUTTON_X1 + xbuttonval - 1;
    3.15  						state = SDL_RELEASED;
    3.16  						break;
    3.17  					default: