mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-16 21:23:46 +00:00
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.
This commit is contained in:
parent
1acd8eb7c3
commit
c256ebdb5c
1 changed files with 2 additions and 2 deletions
|
|
@ -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];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue