Keyboard layout ahk code example

Example: Keyboard layout ahk

F9::
SetFormat, Integer, H
aac1:= % DllCall("GetKeyboardLayout", Int,DllCall("GetWindowThreadProcessId", int,WinActive("A"), Int,0))
msgbox,AAC1=%aac1%
SetFormat, Integer, D
Clipboard=%aac1%
return

F10::
switch aac1{
            case "-0xFFDF7F7":{ ; Your remap for dvorak
               Tooltip, Dvorak/us layout selected!
               ^q::^x   ;# cut
               ^j::^c   ;# copy
               ^k::^v   ;# pase
               return
            } 
               
            case "0x8090809":{ ; Your remap for Default
               Tooltip, Uk layout selected!
               ^x::^x   ;# cut
               ^c::^c   ;# copy
               ^v::^v   ;# pase
               return
            }
            
               case "0x4090409":{ ; Your remap for Default
               Tooltip, Us layout selected!
               ^x::^x   ;# cut
               ^c::^c   ;# copy
               ^v::^v   ;# pase
               return
            } 
} 
return

Tags:

Misc Example