From d7845deb4c91ff48064c73ee649f04c793b37479 Mon Sep 17 00:00:00 2001 From: Andrew Malchuk Date: Sat, 7 Sep 2024 02:09:21 +0400 Subject: [PATCH 1/2] Fix Windows key bind name on non-Mac --- .gitignore | 1 + src/client/input/sdl2.c | 15 ++++++++++----- src/client/input/sdl3.c | 13 +++++++++---- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index e6077224..a2f6e564 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.vscode/ /build/ /release/ *.mk diff --git a/src/client/input/sdl2.c b/src/client/input/sdl2.c index 050c8ae2..1e8c1896 100644 --- a/src/client/input/sdl2.c +++ b/src/client/input/sdl2.c @@ -235,10 +235,17 @@ IN_TranslateSDLtoQ2Key(unsigned int keysym) case SDLK_BACKSPACE: key = K_BACKSPACE; break; - case SDLK_LGUI: +#ifdef __APPLE__ case SDLK_RGUI: - key = K_COMMAND; // Win key + case SDLK_LGUI: + key = K_COMMAND; break; +#else + case SDLK_RGUI: + case SDLK_LGUI: + key = K_SUPER; + break; +#endif case SDLK_CAPSLOCK: key = K_CAPSLOCK; break; @@ -394,8 +401,6 @@ IN_TranslateSDLtoQ2Key(unsigned int keysym) key = K_KP_EQUALS; break; - // TODO: K_SUPER ? Win Key is already K_COMMAND - case SDLK_APPLICATION: key = K_COMPOSE; break; @@ -662,7 +667,7 @@ IN_Update(void) event.window.event == SDL_WINDOWEVENT_FOCUS_GAINED) { Key_MarkAllUp(); - + if (event.window.event == SDL_WINDOWEVENT_FOCUS_LOST) { S_Activate(false); diff --git a/src/client/input/sdl3.c b/src/client/input/sdl3.c index 40e778c0..49a62dfb 100644 --- a/src/client/input/sdl3.c +++ b/src/client/input/sdl3.c @@ -225,10 +225,17 @@ IN_TranslateSDLtoQ2Key(unsigned int keysym) case SDLK_BACKSPACE: key = K_BACKSPACE; break; - case SDLK_LGUI: +#ifdef __APPLE__ case SDLK_RGUI: - key = K_COMMAND; // Win key + case SDLK_LGUI: + key = K_COMMAND; break; +#else + case SDLK_RGUI: + case SDLK_LGUI: + key = K_SUPER; + break; +#endif case SDLK_CAPSLOCK: key = K_CAPSLOCK; break; @@ -384,8 +391,6 @@ IN_TranslateSDLtoQ2Key(unsigned int keysym) key = K_KP_EQUALS; break; - // TODO: K_SUPER ? Win Key is already K_COMMAND - case SDLK_APPLICATION: key = K_COMPOSE; break; From dfc0cf059b26f3c8ba6895004bfce10b2a25acf7 Mon Sep 17 00:00:00 2001 From: Andrew Malchuk Date: Sun, 8 Sep 2024 13:45:55 +0400 Subject: [PATCH 2/2] Removed .vscode from .gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index a2f6e564..e6077224 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -.vscode/ /build/ /release/ *.mk