Bean2014 Posted December 6, 2014 Share Posted December 6, 2014 Sorry but Im newbie at autoit, so I dont know how to do this. I often type in two languages: English and Vietnamese. And I use Unikey to switch 2 languages above (by hot key CTRL + SHIFT). Now I want to check: If in Vietnamese, It will change to English automaticaly (or vice versa) Could anyone help me to do this! Thanks! Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted December 6, 2014 Moderators Share Posted December 6, 2014 No one will just write the code for you, this is a teach to fish type forum. Area's you'll want to look in the help file: _WinAPI_GetDesktopWindow _WinAPI_GetKeyboardLayout _WinAPI_LoadKeyboardLayout To help you understand and get started: #include <WinAPI.au3> #include <WinAPISys.au3> #include <APILocaleConstants.au3> #include <WinAPILocale.au3> Local $hWnd = _WinAPI_GetDesktopWindow() Local $iLocale = _WinAPI_GetKeyboardLayout($hWnd) $iLocale = _WinAPI_LoWord($iLocale) Local $sLocale = _WinAPI_GetLocaleInfo($iLocale, $LOCALE_SLANGUAGE) MsgBox(64, "Info", "Current language layout: " & $sLocale) Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Bean2014 Posted December 6, 2014 Author Share Posted December 6, 2014 I dont know why but I think Unikey dont affect the input language. Because when I use Unkey in the English mode or Vietnamese mode, the input language dont change (It always show EN in the language bar) Link to comment Share on other sites More sharing options...
LWC Posted July 24, 2020 Share Posted July 24, 2020 (edited) On 12/6/2014 at 12:40 PM, SmOke_N said: To help you understand and get started: #include <WinAPI.au3> #include <WinAPISys.au3> #include <APILocaleConstants.au3> #include <WinAPILocale.au3> Local $hWnd = _WinAPI_GetDesktopWindow() Local $iLocale = _WinAPI_GetKeyboardLayout($hWnd) $iLocale = _WinAPI_LoWord($iLocale) Local $sLocale = _WinAPI_GetLocaleInfo($iLocale, $LOCALE_SLANGUAGE) MsgBox(64, "Info", "Current language layout: " & $sLocale) To me this always brings the default input. To get the current input, one can just use the following built-in command: @KBLayout Edited July 24, 2020 by LWC Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now