The keycode in key events is affected by modifiers by default.

This behavior can be customized with SDL_HINT_KEYCODE_OPTIONS.
This commit is contained in:
Sam Lantinga
2024-06-22 00:04:33 -07:00
parent 1e81424b3d
commit 90034b16dc
6 changed files with 149 additions and 29 deletions

View File

@@ -234,7 +234,7 @@ static void loop(void)
SDL_Log("Cleared audio stream");
} else if (sym == SDLK_s) {
queue_audio();
} else if (sym == SDLK_d) {
} else if (sym == SDLK_d || sym == SDLK_D) {
float amount = 1.0f;
amount *= (e.key.mod & SDL_KMOD_CTRL) ? 10.0f : 1.0f;
amount *= (e.key.mod & SDL_KMOD_SHIFT) ? 10.0f : 1.0f;