From 65f6b1dc35fecffa944324af17869f1955d09bde Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sat, 8 Aug 2015 22:13:24 +0200 Subject: [PATCH] Fix display of key names in the keyboard configuration screen. --- src/CKeyboard.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/CKeyboard.cpp b/src/CKeyboard.cpp index 89e6e0e..955e503 100644 --- a/src/CKeyboard.cpp +++ b/src/CKeyboard.cpp @@ -39,16 +39,18 @@ void Keyboard::setDefaultKeys() control[CONTROL::MAP] = SDL_SCANCODE_TAB; } -const char *Keyboard::translateKey(int key) +const char *Keyboard::translateKey(int scancode) { static char keyName[50]; keyName[0] = 0; keyName[0] = '\0'; - if (key <= 0) + if (scancode <= 0) { return "..."; } + + SDL_Keycode key = SDL_GetKeyFromScancode((SDL_Scancode)scancode); strlcpy(keyName, _(SDL_GetKeyName(key)), sizeof keyName); -- 2.39.5