src/events/SDL_mouse.c
changeset 12934 d03900e991a2
parent 12929 d6c5eb7a0afb
child 12943 49190e92b7d1
equal deleted inserted replaced
12933:895066b9f1b4 12934:d03900e991a2
   336                 SDL_SendTouchMotion(SDL_MOUSE_TOUCHID, 0, fx, fy, 1.0f);
   336                 SDL_SendTouchMotion(SDL_MOUSE_TOUCHID, 0, fx, fy, 1.0f);
   337             }
   337             }
   338         }
   338         }
   339     }
   339     }
   340 
   340 
       
   341     /* SDL_HINT_TOUCH_MOUSE_EVENTS: if not set, discard synthetic mouse events coming from platform layer */
       
   342     if (mouse->touch_mouse_events == 0) {
       
   343         if (mouseID == SDL_TOUCH_MOUSEID) {
       
   344             return 0;
       
   345         }
       
   346     }
       
   347 
   341     if (mouseID != SDL_TOUCH_MOUSEID && mouse->relative_mode_warp) {
   348     if (mouseID != SDL_TOUCH_MOUSEID && mouse->relative_mode_warp) {
   342         int center_x = 0, center_y = 0;
   349         int center_x = 0, center_y = 0;
   343         SDL_GetWindowSize(window, &center_x, &center_y);
   350         SDL_GetWindowSize(window, &center_x, &center_y);
   344         center_x /= 2;
   351         center_x /= 2;
   345         center_y /= 2;
   352         center_y /= 2;
   494             if (window) {
   501             if (window) {
   495                 float fx = (float)mouse->x / (float)window->w;
   502                 float fx = (float)mouse->x / (float)window->w;
   496                 float fy = (float)mouse->y / (float)window->h;
   503                 float fy = (float)mouse->y / (float)window->h;
   497                 SDL_SendTouch(SDL_MOUSE_TOUCHID, 0, track_mouse_down, fx, fy, 1.0f);
   504                 SDL_SendTouch(SDL_MOUSE_TOUCHID, 0, track_mouse_down, fx, fy, 1.0f);
   498             }
   505             }
       
   506         }
       
   507     }
       
   508 
       
   509     /* SDL_HINT_TOUCH_MOUSE_EVENTS: if not set, discard synthetic mouse events coming from platform layer */
       
   510     if (mouse->touch_mouse_events == 0) {
       
   511         if (mouseID == SDL_TOUCH_MOUSEID) {
       
   512             return 0;
   499         }
   513         }
   500     }
   514     }
   501 
   515 
   502     /* Figure out which event to perform */
   516     /* Figure out which event to perform */
   503     switch (state) {
   517     switch (state) {