UE Editors activates US Keyboard layout. Can I stop it?

I use a custom Windows keyboard layout.
Each time I launch UE editor it activates the US keyboard layout.
Is there a way to stop it doing this?
Thanks.

1 Like

Hi @OrfWare

I am guessing that Unreal Editor changes the keyboard type based on your language and region settings. i.e. Mine are default to English (United Kingdom).

So unless your keyboard layout is in a language/region within windows its will override.

How are you making your custom layout? If you “Added” a language then go see if the language appears in the Editor Preferences.

Type Locale in the search box and Editor Locale has a list in there, try that and see!

Stewart

If you want to add you keyboard layout to a windows language try this:
How do I change the layout of my keyboard in Windows 10? - Coolblue - anything for a smile

I use my version of the italian keyboard (I used Microsoft Keyboard Layout Creator) but my settings are English…
I’ll try what you suggest, thank you.

1 Like

Did you ever solve this problem?

This is driving me nuts, its been going on for at least since 5.1, and is still present in 5.3.

I’m using norwegian, and it is the only keyboard layout I have in Windows keyboard settings.

Still, for some mysterious reason, when I start Unreal, half of the times it changes my keyboard layout to US/english.

I checked the editor preferences in Unreal, its norwegian as its supposed:

image

No news, sorry…

Any update on THIS ?!?! what kind of madness is this ?

Hey,
I had the same issue… What solved it for me was to enable the keyboard layout switcher on the taskbar, I saw it switch to US layout when activating the UE window, then switched it manually to my locale and it worked ever since.

It is incredibly annoying.

The only “solution” I have is to manually enter Windows Settings → Language & Region → Input → Advance Keyboardsettings → Switch between German and “Languagelist” back and forth once.

This has been happening to me somewhat often too (I normally use Dvorak, but I have QWERTY installed too). The problem seems to occur when there are nested calls to GetHKLDescriptionAsFString (see call stack below), apparently due to some Windows input stuff invoking some other callback in the Unreal code. GetHKLDescriptionAsFString temporarily changes to the keyboard layout of interest in order to retrieve its name, but when the nested calls happen the old layout doesn’t get restored - even though Windows says it has been - and now you’re stuck with the new one.

This appears to be related somehow to window focus changing, so I stuck a SetForegroundWindow call in to decrease the chances that the temporary layout is activated with one window in the foreground and deactivated with another. That seems to have fixed my 100% repro case that I was inducing using the debugger, but time will have to tell whether it also fixes all the cases where you’re just loading the editor without expecting the keyboard layout to change. Not a proper fix but maybe it’ll provide some clues?

Code and some info here: Maybe fix Unreal Editor changing the keyboard layout when it starts up · GitHub - I left some extra commented-out debug stuff in there in case it comes in handy

–Tom

P.S. I’m using Windows 11 23H2 and UE 5.3.2

Call stack:

  UnrealEditor-ApplicationCore-Win64-Debug.dll!`anonymous namespace'::GetHKLDescriptionAsFString(HKL__ * KeyboardLayout) Line 72	C++
  UnrealEditor-ApplicationCore-Win64-Debug.dll!FWindowsTextInputMethodSystem::LogActiveInputMethod() Line 381	C++
  UnrealEditor-ApplicationCore-Win64-Debug.dll!FWindowsTextInputMethodSystem::OnIMEActivationStateChanged(const bool bIsEnabled) Line 978	C++
  UnrealEditor-ApplicationCore-Win64-Debug.dll!FTSFActivationProxy::OnActivated(unsigned long dwProfileType, unsigned short langid, const _GUID & clsid, const _GUID & catid, const _GUID & guidProfile, HKL__ * hkl, unsigned long dwFlags) Line 255	C++
  msctf.dll!CThreadInputMgr::ActivateInputProfile()	Unknown
  msctf.dll!CThreadInputMgr::OnCleanupContextsEnded()	Unknown
  msctf.dll!CCleanupShared::~CCleanupShared()	Unknown
  msctf.dll!CCleanupShared::Release()	Unknown
  msctf.dll!CThreadInputMgr::_CleanupContexts()	Unknown
  msctf.dll!CThreadInputMgr::OnActiveProfileChange()	Unknown
  msctf.dll!CInputProfileManager::ActivateProfile(class CInputLanguage *,struct CInputProfile *)	Unknown
  msctf.dll!CInputProfileManager::OnKeyboardLayoutListChange()	Unknown
  msctf.dll!CInputProfileManager::OnActiveKeyboardLayoutChange(struct HKL__ *)	Unknown
  msctf.dll!CInputProfileManager::OnCiceroEvent()	Unknown
  msctf.dll!WinEventProc(struct HWINEVENTHOOK__ *,unsigned long,struct HWND__ *,long,long,unsigned long,unsigned long)	Unknown
  user32.dll!__ClientCallWinEventProc()	Unknown
  ntdll.dll!KiUserCallbackDispatcherContinue()	Unknown
  win32u.dll!NtUserActivateKeyboardLayout()	Unknown
  UnrealEditor-ApplicationCore-Win64-Debug.dll!`anonymous namespace'::GetHKLDescriptionAsFString(HKL__ * KeyboardLayout) Line 87	C++
  UnrealEditor-ApplicationCore-Win64-Debug.dll!FWindowsTextInputMethodSystem::Initialize() Line 332	C++
  UnrealEditor-ApplicationCore-Win64-Debug.dll!FWindowsApplication::FWindowsApplication(HINSTANCE__ * const HInstance, HICON__ * const IconHandle) Line 158	C++
  UnrealEditor-ApplicationCore-Win64-Debug.dll!FWindowsApplication::CreateWindowsApplication(HINSTANCE__ * const InstanceHandle, HICON__ * const IconHandle) Line 107	C++
  UnrealEditor-ApplicationCore-Win64-Debug.dll!FWindowsPlatformApplicationMisc::CreateApplication() Line 92	C++
  UnrealEditor-Slate-Win64-Debug.dll!FSlateApplication::Create() Line 719	C++
  UnrealEditor-Win64-Debug.exe!FEngineLoop::PreInitPreStartupScreen(const wchar_t * CmdLine) Line 3156	C++
  UnrealEditor-Win64-Debug.exe!FEngineLoop::PreInit(const wchar_t * CmdLine) Line 4407	C++
  UnrealEditor-Win64-Debug.exe!EnginePreInit(const wchar_t * CmdLine) Line 41	C++
  UnrealEditor-Win64-Debug.exe!GuardedMain(const wchar_t * CmdLine) Line 140	C++
  UnrealEditor-Win64-Debug.exe!LaunchWindowsStartup(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow, const wchar_t * CmdLine) Line 247	C++
  UnrealEditor-Win64-Debug.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * pCmdLine, int nCmdShow) Line 298	C++