Android: add name for Touch devices and simplification, from bug 3958

This commit is contained in:
Sylvain Becker
2019-01-10 21:40:57 +01:00
parent d23c2f07e3
commit 7a1d1baefc
4 changed files with 30 additions and 44 deletions

View File

@@ -63,19 +63,11 @@ SeparateEventsHintWatcher(void *userdata, const char *name,
void Android_InitTouch(void)
{
int i;
int *ids;
const int number = Android_JNI_GetTouchDeviceIds(&ids);
SDL_AddHintCallback(SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH,
SeparateEventsHintWatcher, NULL);
if (0 < number) {
for (i = 0; i < number; ++i) {
SDL_AddTouch((SDL_TouchID) ids[i], SDL_TOUCH_DEVICE_DIRECT, ""); /* no error handling */
}
SDL_free(ids);
}
/* Add all touch devices */
Android_JNI_InitTouch();
}
void Android_QuitTouch(void)