summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonathan G Rennison <j.g.rennison@gmail.com>2019-11-04 17:59:04 +0000
committerCharles Pigott <charlespigott@googlemail.com>2019-11-10 17:58:42 +0000
commit3db399d7d9a0545d97669efb8fe1086e2cb83477 (patch)
tree7c8605e3d85c7891b95da6c7b3e1d03707c73f68 /src
parent3d362f251337a248b020dc32d374bbaa94f6d7a3 (diff)
downloadopenttd-3db399d7d9a0545d97669efb8fe1086e2cb83477.tar.xz
Fix: [SDL2] Detection of backtick scancode
SDL_Keysym::scancode is a SDL_SCANCODE_* constant, not a raw scan code
Diffstat (limited to 'src')
-rw-r--r--src/video/sdl2_v.cpp13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/video/sdl2_v.cpp b/src/video/sdl2_v.cpp
index 4515dd3c5..d85c765f9 100644
--- a/src/video/sdl2_v.cpp
+++ b/src/video/sdl2_v.cpp
@@ -428,18 +428,7 @@ static uint ConvertSdlKeyIntoMy(SDL_Keysym *sym, WChar *character)
}
/* check scancode for BACKQUOTE key, because we want the key left of "1", not anything else (on non-US keyboards) */
-#if defined(_WIN32) || defined(__OS2__)
- if (sym->scancode == 41) key = WKC_BACKQUOTE;
-#elif defined(__APPLE__)
- if (sym->scancode == 10) key = WKC_BACKQUOTE;
-#elif defined(__SVR4) && defined(__sun)
- if (sym->scancode == 60) key = WKC_BACKQUOTE;
- if (sym->scancode == 49) key = WKC_BACKSPACE;
-#elif defined(__sgi__)
- if (sym->scancode == 22) key = WKC_BACKQUOTE;
-#else
- if (sym->scancode == 49) key = WKC_BACKQUOTE;
-#endif
+ if (sym->scancode == SDL_SCANCODE_GRAVE) key = WKC_BACKQUOTE;
/* META are the command keys on mac */
if (sym->mod & KMOD_GUI) key |= WKC_META;