From 208cd434b556e8948bec09fab8c12b6789ba5b6b Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 23 Mar 2024 15:50:16 -0700 Subject: [PATCH] Show the names of mice and keyboards when they connect --- test/testhotplug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testhotplug.c b/test/testhotplug.c index 8f09d7dbf..ac61ec9ea 100644 --- a/test/testhotplug.c +++ b/test/testhotplug.c @@ -103,13 +103,13 @@ int main(int argc, char *argv[]) keepGoing = SDL_FALSE; break; case SDL_EVENT_KEYBOARD_ADDED: - SDL_Log("Keyboard added : %" SDL_PRIu32 "\n", event.kdevice.which); + SDL_Log("Keyboard '%s' added : %" SDL_PRIu32 "\n", SDL_GetKeyboardInstanceName(event.kdevice.which), event.kdevice.which); break; case SDL_EVENT_KEYBOARD_REMOVED: SDL_Log("Keyboard removed: %" SDL_PRIu32 "\n", event.kdevice.which); break; case SDL_EVENT_MOUSE_ADDED: - SDL_Log("Mouse added : %" SDL_PRIu32 "\n", event.mdevice.which); + SDL_Log("Mouse '%s' added : %" SDL_PRIu32 "\n", SDL_GetMouseInstanceName(event.mdevice.which), event.mdevice.which); break; case SDL_EVENT_MOUSE_REMOVED: SDL_Log("Mouse removed: %" SDL_PRIu32 "\n", event.mdevice.which);