Detect current keyboard language/layout name in multi-language computer

前端 未结 6 1449
感动是毒
感动是毒 2020-12-09 00:06

I am trying to develop an application in C# which required to detect user selected language (keyboard layout). However two languages are installed on my computer, the code a

6条回答
  •  情话喂你
    2020-12-09 00:28

    You've gotta uncheck the setting let me set a different input method for each app window under Settings/Devices/Typing/Advanced Keyboard for the

    string lang = InputLanguage.CurrentInputLanguage.Culture.Name;
    

    to work. If you do so, it will return the current language layout that you use to type, even if it's different to your default keyboard language.

提交回复
热议问题