Unable to automatically change the keyboard layout

keyboard
studio
language

#1

Hello.

I need to switch to the US keyboard automatically everytime the process is launched.
I use three ‘Assign’ activities.

In the first I assign to a new variable culture = new CultureInfo(“US”)
In the next one I assign System.Threading.Thread.CurrentThread.CurrentCulture = culture
In the last one I assign InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(culture)

In the message box it shows that it’s changed if I launch my project with a non-US keyboard layout. It displays “US” in the message box. But in the system itself it doesn’t change. So if I start with a non-US keyboard it still remains non-US while the Message Box shows different.

What am I doing wrong?

P.S. Variants like use “shift + alt” or any other keyboards are forbidden here. No any Send Hotkeys or Type Into. I need to do it using programming commands strictly.
P.S.S. The example is attached SwitchLanguage.xaml (7.0 KB)

@ovi


Send Hotkey works incorrectly with non-English languages
#2

Well I’ve found out that you can’t switch keyboard layout without sticking to a windows process as there is no “general” system keyboard layout in Windows. Hence, you either need to point out a system process and modify its input layout using some coding or simulate shift + alt (depending on your settings) with ‘Send Hotkey’ activity or somehow else. So the problem is kind of solved.