mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-14 04:03:46 +00:00
- Added a default keyboard layout for launching the game. It's fixed crash when a game running with the extend unicode keyboard (cyrillic, for example).
This commit is contained in:
parent
65099897f4
commit
e18fbcfb89
5 changed files with 41 additions and 2 deletions
|
|
@ -33,6 +33,8 @@
|
|||
#include <stdarg.h>
|
||||
#endif
|
||||
|
||||
#include <sstream>
|
||||
|
||||
// Static class variables:
|
||||
InputManager* Input::smManager;
|
||||
bool Input::smActive;
|
||||
|
|
@ -79,6 +81,10 @@ void Input::init()
|
|||
|
||||
destroy();
|
||||
|
||||
#ifdef TORQUE_DEFAULT_KEYBOARD_LAYOUT
|
||||
attemptSwitchToKeyboardLayout( TORQUE_DEFAULT_KEYBOARD_LAYOUT );
|
||||
#endif
|
||||
|
||||
#ifdef LOG_INPUT
|
||||
struct tm* newTime;
|
||||
time_t aclock;
|
||||
|
|
@ -487,6 +493,18 @@ InputManager* Input::getManager()
|
|||
return( smManager );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void Input::attemptSwitchToKeyboardLayout( U32 layout )
|
||||
{
|
||||
const auto lang = MAKELANGID( layout, SUBLANG_DEFAULT );
|
||||
std::wstringstream ss;
|
||||
ss << std::hex << lang;
|
||||
const auto hexLang = ss.str().c_str();
|
||||
ActivateKeyboardLayout( LoadKeyboardLayout(
|
||||
hexLang, KLF_ACTIVATE | KLF_REPLACELANG
|
||||
), KLF_REORDER );
|
||||
}
|
||||
|
||||
#ifdef LOG_INPUT
|
||||
//------------------------------------------------------------------------------
|
||||
void Input::log( const char* format, ... )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue