From c256ebdb5cde5d34665927b8d3af23dcec343bfc Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Thu, 10 Jan 2019 04:15:22 -0500 Subject: [PATCH 1/2] Fix Input::getKeyCode on software keyboard layouts Input::getAscii goes Torque keyCode -> SDL Scancode -> SDL Keycode -> SDL ascii key name Input::getKeycode used to be SDL ascii key name -> SDL Scancode -> Torque keyCode This mismatch made software keyboard layouts behave incorrectly in different places. For example, you would bind a key to an ActionMap and it would activate with a different button than specified. --- Engine/source/platformSDL/sdlInput.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Engine/source/platformSDL/sdlInput.cpp b/Engine/source/platformSDL/sdlInput.cpp index eb9e3dd8e..99793609b 100644 --- a/Engine/source/platformSDL/sdlInput.cpp +++ b/Engine/source/platformSDL/sdlInput.cpp @@ -118,7 +118,7 @@ U16 Input::getKeyCode( U16 asciiCode ) char c[2]; c[0]= asciiCode; c[1] = NULL; - return KeyMapSDL::getTorqueScanCodeFromSDL( SDL_GetScancodeFromName( c ) ); + return KeyMapSDL::getTorqueScanCodeFromSDL( SDL_GetScancodeFromKey( SDL_GetKeyFromName(c) ) ); } //------------------------------------------------------------------------------ @@ -435,4 +435,4 @@ U32 KeyMapSDL::getSDLScanCodeFromTorque(U32 torque) buildScanCodeArray(); return T3D_SDL[torque]; -} \ No newline at end of file +} From 2739d8713a3f39b01da1852137c527ebe1efc343 Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Thu, 10 Jan 2019 04:18:35 -0500 Subject: [PATCH 2/2] Really, github?