Nobody will EVER use more than 8 buttons. Oh wait... Nobody will EVER use more than 32 buttons...

This commit is contained in:
Sam Lantinga 2012-11-12 12:14:44 -08:00
parent 414515401f
commit ea22b37504
3 changed files with 7 additions and 7 deletions

View file

@ -74,7 +74,7 @@ extern DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void);
* mouse cursor position relative to the focus window for the currently * mouse cursor position relative to the focus window for the currently
* selected mouse. You can pass NULL for either x or y. * selected mouse. You can pass NULL for either x or y.
*/ */
extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y); extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *y);
/** /**
* \brief Retrieve the relative state of the mouse. * \brief Retrieve the relative state of the mouse.
@ -83,7 +83,7 @@ extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y);
* be tested using the SDL_BUTTON(X) macros, and x and y are set to the * be tested using the SDL_BUTTON(X) macros, and x and y are set to the
* mouse deltas since the last call to SDL_GetRelativeMouseState(). * mouse deltas since the last call to SDL_GetRelativeMouseState().
*/ */
extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int *x, int *y); extern DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(int *x, int *y);
/** /**
* \brief Moves the mouse to the given position within the window. * \brief Moves the mouse to the given position within the window.

View file

@ -118,7 +118,7 @@ SDL_SetMouseFocus(SDL_Window * window)
/* Check to see if we need to synthesize focus events */ /* Check to see if we need to synthesize focus events */
static SDL_bool static SDL_bool
SDL_UpdateMouseFocus(SDL_Window * window, int x, int y, Uint8 buttonstate) SDL_UpdateMouseFocus(SDL_Window * window, int x, int y, Uint32 buttonstate)
{ {
SDL_Mouse *mouse = SDL_GetMouse(); SDL_Mouse *mouse = SDL_GetMouse();
int w, h; int w, h;
@ -264,7 +264,7 @@ SDL_SendMouseButton(SDL_Window * window, Uint8 state, Uint8 button)
SDL_Mouse *mouse = SDL_GetMouse(); SDL_Mouse *mouse = SDL_GetMouse();
int posted; int posted;
Uint32 type; Uint32 type;
Uint8 buttonstate = mouse->buttonstate; Uint32 buttonstate = mouse->buttonstate;
/* Figure out which event to perform */ /* Figure out which event to perform */
switch (state) { switch (state) {
@ -345,7 +345,7 @@ SDL_MouseQuit(void)
{ {
} }
Uint8 Uint32
SDL_GetMouseState(int *x, int *y) SDL_GetMouseState(int *x, int *y)
{ {
SDL_Mouse *mouse = SDL_GetMouse(); SDL_Mouse *mouse = SDL_GetMouse();
@ -359,7 +359,7 @@ SDL_GetMouseState(int *x, int *y)
return mouse->buttonstate; return mouse->buttonstate;
} }
Uint8 Uint32
SDL_GetRelativeMouseState(int *x, int *y) SDL_GetRelativeMouseState(int *x, int *y)
{ {
SDL_Mouse *mouse = SDL_GetMouse(); SDL_Mouse *mouse = SDL_GetMouse();

View file

@ -58,7 +58,7 @@ typedef struct
int xdelta; int xdelta;
int ydelta; int ydelta;
int last_x, last_y; /* the last reported x and y coordinates */ int last_x, last_y; /* the last reported x and y coordinates */
Uint8 buttonstate; Uint32 buttonstate;
SDL_bool relative_mode; SDL_bool relative_mode;
/* the x and y coordinates when relative mode was activated */ /* the x and y coordinates when relative mode was activated */
int original_x, original_y; int original_x, original_y;