Android: remove SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH

java layer runs as if separate mouse and touch was 1,
Use SDL_HINT_MOUSE_TOUCH_EVENTS and SDL_HINT_TOUCH_MOUSE_EVENTS
for generating synthetic touch/mouse events
This commit is contained in:
Sylvain Becker
2019-04-04 17:01:02 +02:00
parent e41576188d
commit bfdd0b228a
6 changed files with 9 additions and 68 deletions

View File

@@ -40,28 +40,15 @@
#define ACTION_POINTER_DOWN 5
#define ACTION_POINTER_UP 6
static void SDLCALL
SeparateEventsHintWatcher(void *userdata, const char *name,
const char *oldValue, const char *newValue)
{
SDL_bool separate_mouse_and_touch = (newValue && (SDL_strcmp(newValue, "1") == 0));
Android_JNI_SetSeparateMouseAndTouch(separate_mouse_and_touch);
}
void Android_InitTouch(void)
{
SDL_AddHintCallback(SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH,
SeparateEventsHintWatcher, NULL);
/* Add all touch devices */
Android_JNI_InitTouch();
}
void Android_QuitTouch(void)
{
SDL_DelHintCallback(SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH,
SeparateEventsHintWatcher, NULL);
return;
}
void Android_OnTouch(SDL_Window *window, int touch_device_id_in, int pointer_finger_id_in, int action, float x, float y, float p)