testgesture: display device name with SDL_GetTouchName()

This commit is contained in:
Sylvain 2022-02-08 11:38:34 +01:00
parent 580d231822
commit 94e5c3f30e
No known key found for this signature in database
GPG Key ID: 5F87E02E5BC0939E
1 changed files with 2 additions and 1 deletions

View File

@ -190,7 +190,8 @@ loop(void)
case SDLK_i: { case SDLK_i: {
for (i = 0; i < SDL_GetNumTouchDevices(); ++i) { for (i = 0; i < SDL_GetNumTouchDevices(); ++i) {
const SDL_TouchID id = SDL_GetTouchDevice(i); const SDL_TouchID id = SDL_GetTouchDevice(i);
SDL_Log("Fingers Down on device %"SDL_PRIs64": %d", id, SDL_GetNumTouchFingers(id)); const char *name = SDL_GetTouchName(i);
SDL_Log("Fingers Down on device %"SDL_PRIs64" (%s): %d", id, name, SDL_GetNumTouchFingers(id));
} }
break; break;
} }