src/events/SDL_mouse.c
changeset 6673 78f18a929123
parent 6667 243bfb5c31d6
child 6675 20f3cdea0fd2
equal deleted inserted replaced
6672:b61791cd595a 6673:78f18a929123
   116     SDL_SetCursor(NULL);
   116     SDL_SetCursor(NULL);
   117 }
   117 }
   118 
   118 
   119 /* Check to see if we need to synthesize focus events */
   119 /* Check to see if we need to synthesize focus events */
   120 static SDL_bool
   120 static SDL_bool
   121 SDL_UpdateMouseFocus(SDL_Window * window, int x, int y, Uint8 buttonstate)
   121 SDL_UpdateMouseFocus(SDL_Window * window, int x, int y, Uint32 buttonstate)
   122 {
   122 {
   123     SDL_Mouse *mouse = SDL_GetMouse();
   123     SDL_Mouse *mouse = SDL_GetMouse();
   124     int w, h;
   124     int w, h;
   125     SDL_bool inWindow;
   125     SDL_bool inWindow;
   126 
   126 
   262 SDL_SendMouseButton(SDL_Window * window, Uint8 state, Uint8 button)
   262 SDL_SendMouseButton(SDL_Window * window, Uint8 state, Uint8 button)
   263 {
   263 {
   264     SDL_Mouse *mouse = SDL_GetMouse();
   264     SDL_Mouse *mouse = SDL_GetMouse();
   265     int posted;
   265     int posted;
   266     Uint32 type;
   266     Uint32 type;
   267     Uint8 buttonstate = mouse->buttonstate;
   267     Uint32 buttonstate = mouse->buttonstate;
   268 
   268 
   269     /* Figure out which event to perform */
   269     /* Figure out which event to perform */
   270     switch (state) {
   270     switch (state) {
   271     case SDL_PRESSED:
   271     case SDL_PRESSED:
   272         type = SDL_MOUSEBUTTONDOWN;
   272         type = SDL_MOUSEBUTTONDOWN;
   343 void
   343 void
   344 SDL_MouseQuit(void)
   344 SDL_MouseQuit(void)
   345 {
   345 {
   346 }
   346 }
   347 
   347 
   348 Uint8
   348 Uint32
   349 SDL_GetMouseState(int *x, int *y)
   349 SDL_GetMouseState(int *x, int *y)
   350 {
   350 {
   351     SDL_Mouse *mouse = SDL_GetMouse();
   351     SDL_Mouse *mouse = SDL_GetMouse();
   352 
   352 
   353     if (x) {
   353     if (x) {
   357         *y = mouse->y;
   357         *y = mouse->y;
   358     }
   358     }
   359     return mouse->buttonstate;
   359     return mouse->buttonstate;
   360 }
   360 }
   361 
   361 
   362 Uint8
   362 Uint32
   363 SDL_GetRelativeMouseState(int *x, int *y)
   363 SDL_GetRelativeMouseState(int *x, int *y)
   364 {
   364 {
   365     SDL_Mouse *mouse = SDL_GetMouse();
   365     SDL_Mouse *mouse = SDL_GetMouse();
   366 
   366 
   367     if (x) {
   367     if (x) {