src/events/SDL_mouse.c
changeset 12934 d03900e991a2
parent 12929 d6c5eb7a0afb
child 12943 49190e92b7d1
     1.1 --- a/src/events/SDL_mouse.c	Tue Jul 09 08:55:00 2019 +0300
     1.2 +++ b/src/events/SDL_mouse.c	Tue Jul 09 11:46:42 2019 +0200
     1.3 @@ -338,6 +338,13 @@
     1.4          }
     1.5      }
     1.6  
     1.7 +    /* SDL_HINT_TOUCH_MOUSE_EVENTS: if not set, discard synthetic mouse events coming from platform layer */
     1.8 +    if (mouse->touch_mouse_events == 0) {
     1.9 +        if (mouseID == SDL_TOUCH_MOUSEID) {
    1.10 +            return 0;
    1.11 +        }
    1.12 +    }
    1.13 +
    1.14      if (mouseID != SDL_TOUCH_MOUSEID && mouse->relative_mode_warp) {
    1.15          int center_x = 0, center_y = 0;
    1.16          SDL_GetWindowSize(window, &center_x, &center_y);
    1.17 @@ -499,6 +506,13 @@
    1.18          }
    1.19      }
    1.20  
    1.21 +    /* SDL_HINT_TOUCH_MOUSE_EVENTS: if not set, discard synthetic mouse events coming from platform layer */
    1.22 +    if (mouse->touch_mouse_events == 0) {
    1.23 +        if (mouseID == SDL_TOUCH_MOUSEID) {
    1.24 +            return 0;
    1.25 +        }
    1.26 +    }
    1.27 +
    1.28      /* Figure out which event to perform */
    1.29      switch (state) {
    1.30      case SDL_PRESSED: