Forum Discussion
Hello!
The Locale parameter (despite its name) specifies the identifier of the layout to be set (as correctly stated in the help topic SetKeyboardLayout Method). The identifier is string of 8 characters composed of the hexadecimal values of language and device identifiers ("00000409" for US English). However the help topic example is not correct and uses only hex value of language id as Locale parameter thus failing the function. We should definitely correct this sample =)
Also note that keyboard layout has no impact on the Keys method as it uses virtual keys for input. So you don't need to change the layout to input different language characters with Keys.
It is strange that SetKeyboardLayout with "00000409" as Locale did not work for you as it did for me. Also according to the screenshot provided lang = 0x0426 was used as Locale. Also please make sure that the language is supported (using IsLanguageSupported) and the device identifier (first four characters of the layout identifier string) corresponds to the layout installed in your system. If it still does not work for you please open a support ticket regarding the issue with more detailed information - we will try our best to reproduce and fix this.
Hope this helps.
Related Content
- 4 years agoshubham1