Sign in to follow this  
Followers 0
Bean2014

how to use autoit to check keyboard type?

3 posts in this topic

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!

Share this post


Link to post
Share on other sites



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.

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0