diff options
author | Sylvain Becker <sylvain.becker@gmail.com> | 2019-04-05 08:36:31 +0200 |
---|---|---|
committer | Sylvain Becker <sylvain.becker@gmail.com> | 2019-04-05 08:36:31 +0200 |
commit | c5078bff167cf4adee8546144a1431f898b0b2c6 (patch) | |
tree | 4da45d84f8654abf455c9463fcd5b70b3b20bbf3 /src | |
parent | 4b77e11c847d1bbf1795f87e546efddb9932ec54 (diff) |
Android: default SDL_HINT_MOUSE_TOUCH_EVENTS to 1 as previous behaviour
Diffstat (limited to 'src')
-rw-r--r-- | src/events/SDL_mouse.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c index 893ecc72bd..ca92f2f4b3 100644 --- a/src/events/SDL_mouse.c +++ b/src/events/SDL_mouse.c @@ -112,14 +112,22 @@ SDL_MouseTouchEventsChanged(void *userdata, const char *name, const char *oldVal { SDL_Mouse *mouse = (SDL_Mouse *)userdata; - if (hint && (*hint == '1' || SDL_strcasecmp(hint, "true") == 0)) { - - SDL_AddTouch(SDL_MOUSE_TOUCHID, SDL_TOUCH_DEVICE_DIRECT, "mouse_input"); - + if (hint == NULL || *hint == '\0') { + /* Default */ +#if defined(__ANDROID__) + mouse->mouse_touch_events = SDL_TRUE; +#else + mouse->mouse_touch_events = SDL_FALSE; +#endif + } else if (*hint == '1' || SDL_strcasecmp(hint, "true") == 0) { mouse->mouse_touch_events = SDL_TRUE; } else { mouse->mouse_touch_events = SDL_FALSE; } + + if (mouse->mouse_touch_events) { + SDL_AddTouch(SDL_MOUSE_TOUCHID, SDL_TOUCH_DEVICE_DIRECT, "mouse_input"); + } } /* Public functions */ |