mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 06:34:35 +00:00
Return the touch device name for SDL_TOUCH_MOUSEID
(cherry picked from commit 3dbd3e43e2)
This commit is contained in:
parent
17cf746550
commit
9848c32d9a
1 changed files with 11 additions and 1 deletions
|
|
@ -428,7 +428,17 @@ const char *SDL_GetMouseNameForID(SDL_MouseID instance_id)
|
|||
name = "Mouse";
|
||||
break;
|
||||
case SDL_TOUCH_MOUSEID:
|
||||
name = "Touch";
|
||||
// We can't tell which touch device it was, just use the first one
|
||||
{
|
||||
SDL_TouchID *devices = SDL_GetTouchDevices(NULL);
|
||||
if (devices) {
|
||||
name = SDL_GetTouchDeviceName(devices[0]);
|
||||
SDL_free(devices);
|
||||
}
|
||||
}
|
||||
if (!name) {
|
||||
name = "Touch";
|
||||
}
|
||||
break;
|
||||
case SDL_PEN_MOUSEID:
|
||||
name = "Pen";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue