testhotplug+testmouse: exit when pressing ESC key

This commit is contained in:
Anonymous Maarten
2025-07-03 02:21:51 +02:00
parent 03489e249a
commit f3bf387caf
2 changed files with 9 additions and 0 deletions

View File

@@ -96,6 +96,11 @@ int main(int argc, char *argv[])
case SDL_EVENT_QUIT:
keepGoing = false;
break;
case SDL_EVENT_KEY_DOWN:
if (event.key.scancode == SDL_SCANCODE_ESCAPE) {
keepGoing = false;
}
break;
case SDL_EVENT_KEYBOARD_ADDED:
SDL_Log("Keyboard '%s' added : %" SDL_PRIu32, SDL_GetKeyboardNameForID(event.kdevice.which), event.kdevice.which);
break;