i32 CKeyboard::SetLocalization(xst_castring& strLang)
		{
			//Find this locale
			LangMap::iterator Itr = m_mLangs.find( LangStr( strLang ) );
			if( Itr == m_mLangs.end() )
			{
				XST_LOG_ERR( "Could not find language: " << strLang << ". If you want to use this language add it first." );
				return XST_FAIL;
			}

			/*HKL aBuff[10];
			GetKeyboardLayoutList( 10, aBuff );
			for(u32 i = 0; i < 10; ++i)
			{
				XST::CDebug::PrintDebugLN( XST::StringUtil::ToString( aBuff[ i ] ) );
			}*/

			m_WinHKL = LoadKeyboardLayoutA( Itr->second.data(), KLF_ACTIVATE );
			if( m_WinHKL == xst_null )
			{
				XST_LOG_ERR( "Failed to set keybaord localization: " << GetLastError() );
				return XST_FAIL;
			}
			if( ActivateKeyboardLayout( m_WinHKL, KLF_RESET ) == 0 )
			{
				XST_LOG_ERR( "Failed to activate the keyboard localization: " << GetLastError() );
				return XST_FAIL;
			}

			m_strCurrLang = strLang;
			return XST_OK;
		}
Example #2
0
/* MAKE_EXPORT LoadKeyboardLayoutW_new=LoadKeyboardLayoutW */
HKL WINAPI LoadKeyboardLayoutW_new(LPCWSTR pwszKLIDW, UINT Flags)
{
	ALLOC_WtoA(pwszKLID);

	return LoadKeyboardLayoutA(pwszKLIDA, Flags);
}