Android: default SDL_HINT_MOUSE_TOUCH_EVENTS to 1 as previous behaviour

This commit is contained in:
Sylvain Becker
2019-04-05 08:36:31 +02:00
parent 6f732d4ee8
commit b470cd9b09
3 changed files with 15 additions and 5 deletions

View File

@@ -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 */