LATEST UPDATES
ShareHolder Finder v0.9.3 is now released!!! Check Product Page for more details.
✉ info@automationdevelopers.com

ITS ALL ABOUT AUTOMATION

Sunday, 17 April 2016

AutoIt - Get Keyboard Layout


Author Post Date Sunday, 17 April 2016
Macro Name: @KBLayout

Returns the code denoting Keyboard Layout. See Microsoft OS Language Identifier Constants and Strings for possible values.

Example is provided below:

#include <MsgBoxConstants.au3>

MsgBox($MB_SYSTEMMODAL, "", "The Keyboard Layout Code is: " & @KBLayout & @CRLF & _
                            "The Keyboard Layout Name is: " & _GetKBLayout())

;Retrieve the Keyboard Layout.
Func _GetKBLayout()
    ;Select the required right most four characters to check.
    Switch StringRight(@KBLayout, 4)
        Case "0407"
            Return "German"
        Case "0409"
            Return "English"
        Case "040A"
            Return "Spanish"
        Case "040B"
            Return "Finnish"
        Case "040C"
            Return "French"
        Case "0410"
            Return "Italian"
        Case "0411"
            Return "Japanese"
        Case "0413"
            Return "Dutch"
        Case "0414"
            Return "Norwegian"
        Case "0415"
            Return "Polish"
        Case "0416"
            Return "Portuguese"
        Case "041D"
            Return "Swedish"

        Case Else
            Return "Other (can't determine with @KBLayout directly)"
    EndSwitch
EndFunc   ;==>_GetKBLayout

Related Posts




Interesting? Share and Let Others Know.

Post a Comment