]> git.mxchange.org Git - quix0rs-blobwars.git/commitdiff
Fix display of key names in the keyboard configuration screen.
authorGuus Sliepen <guus@debian.org>
Sat, 8 Aug 2015 20:13:24 +0000 (22:13 +0200)
committerGuus Sliepen <guus@debian.org>
Sat, 8 Aug 2015 20:13:24 +0000 (22:13 +0200)
src/CKeyboard.cpp

index 89e6e0ec8d710757f901994b329a05c192f7c453..955e503ce594131e20076ad2a6b507cb417eaf66 100644 (file)
@@ -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);