src/events/SDL_mouse.c
changeset 12692 69f24f4ef99e
parent 12688 cc45bcb16ef2
child 12695 0c4d04572622
     1.1 --- a/src/events/SDL_mouse.c	Thu Apr 04 20:24:22 2019 +0200
     1.2 +++ b/src/events/SDL_mouse.c	Fri Apr 05 08:36:31 2019 +0200
     1.3 @@ -112,14 +112,22 @@
     1.4  {
     1.5      SDL_Mouse *mouse = (SDL_Mouse *)userdata;
     1.6  
     1.7 -    if (hint && (*hint == '1' || SDL_strcasecmp(hint, "true") == 0)) {
     1.8 -
     1.9 -        SDL_AddTouch(SDL_MOUSE_TOUCHID, SDL_TOUCH_DEVICE_DIRECT, "mouse_input");
    1.10 -
    1.11 +    if (hint == NULL || *hint == '\0') {
    1.12 +        /* Default */
    1.13 +#if defined(__ANDROID__)
    1.14 +        mouse->mouse_touch_events = SDL_TRUE;
    1.15 +#else
    1.16 +        mouse->mouse_touch_events = SDL_FALSE;
    1.17 +#endif
    1.18 +    } else if (*hint == '1' || SDL_strcasecmp(hint, "true") == 0) {
    1.19          mouse->mouse_touch_events = SDL_TRUE;
    1.20      } else {
    1.21          mouse->mouse_touch_events = SDL_FALSE;
    1.22      }
    1.23 +
    1.24 +    if (mouse->mouse_touch_events) {
    1.25 +        SDL_AddTouch(SDL_MOUSE_TOUCHID, SDL_TOUCH_DEVICE_DIRECT, "mouse_input");
    1.26 +    }
    1.27  }
    1.28  
    1.29  /* Public functions */