Fixed bug #464
authorSam Lantinga <slouken@libsdl.org>
Sat, 29 Dec 2007 06:09:25 +0000
changeset 2284545fbf461c5b
parent 2283 546f7c1eb755
child 2285 a5de28552be4
Fixed bug #464
Added X1/X2 button constants
include/SDL_mouse.h
src/video/win32/SDL_win32events.c
     1.1 --- a/include/SDL_mouse.h	Sat Dec 29 03:25:11 2007 +0000
     1.2 +++ b/include/SDL_mouse.h	Sat Dec 29 06:09:25 2007 +0000
     1.3 @@ -207,9 +207,13 @@
     1.4  #define SDL_BUTTON_LEFT		1
     1.5  #define SDL_BUTTON_MIDDLE	2
     1.6  #define SDL_BUTTON_RIGHT	3
     1.7 +#define SDL_BUTTON_X1		4
     1.8 +#define SDL_BUTTON_X2		5
     1.9  #define SDL_BUTTON_LMASK	SDL_BUTTON(SDL_BUTTON_LEFT)
    1.10  #define SDL_BUTTON_MMASK	SDL_BUTTON(SDL_BUTTON_MIDDLE)
    1.11  #define SDL_BUTTON_RMASK	SDL_BUTTON(SDL_BUTTON_RIGHT)
    1.12 +#define SDL_BUTTON_X1MASK	SDL_BUTTON(SDL_BUTTON_X1)
    1.13 +#define SDL_BUTTON_X2MASK	SDL_BUTTON(SDL_BUTTON_X2)
    1.14  
    1.15  
    1.16  /* Ends C function definitions when using C++ */
     2.1 --- a/src/video/win32/SDL_win32events.c	Sat Dec 29 03:25:11 2007 +0000
     2.2 +++ b/src/video/win32/SDL_win32events.c	Sat Dec 29 06:09:25 2007 +0000
     2.3 @@ -590,12 +590,12 @@
     2.4                  break;
     2.5              case WM_XBUTTONDOWN:
     2.6                  xbuttonval = GET_XBUTTON_WPARAM(wParam);
     2.7 -                button = SDL_BUTTON_RIGHT + xbuttonval;
     2.8 +                button = SDL_BUTTON_X1 + xbuttonval - 1;
     2.9                  state = SDL_PRESSED;
    2.10                  break;
    2.11              case WM_XBUTTONUP:
    2.12                  xbuttonval = GET_XBUTTON_WPARAM(wParam);
    2.13 -                button = SDL_BUTTON_RIGHT + xbuttonval;
    2.14 +                button = SDL_BUTTON_X1 + xbuttonval - 1;
    2.15                  state = SDL_RELEASED;
    2.16                  break;
    2.17              default: