Added SDL_ReloadGamepadMappings() to reset the SDL gamepad mappings

This commit is contained in:
Sam Lantinga
2023-07-18 12:50:10 -07:00
parent 75e7a6fcfa
commit 9db2cb3513
6 changed files with 83 additions and 38 deletions

View File

@@ -1627,6 +1627,8 @@ static void loop(void *arg)
OpenVirtualGamepad();
} else if (event.key.keysym.sym == SDLK_d) {
CloseVirtualGamepad();
} else if (event.key.keysym.sym == SDLK_r && (event.key.keysym.mod & SDL_KMOD_CTRL)) {
SDL_ReloadGamepadMappings();
} else if (event.key.keysym.sym == SDLK_ESCAPE) {
done = SDL_TRUE;
}