aboutsummaryrefslogtreecommitdiff
path: root/tt.layout.ahk
diff options
context:
space:
mode:
Diffstat (limited to 'tt.layout.ahk')
-rw-r--r--tt.layout.ahk50
1 files changed, 25 insertions, 25 deletions
diff --git a/tt.layout.ahk b/tt.layout.ahk
index 4ce61b0..700afa4 100644
--- a/tt.layout.ahk
+++ b/tt.layout.ahk
@@ -14,30 +14,30 @@ return
;; -> init
layouts := { ru: DllCall("LoadKeyboardLayout", "Str", "00000419", "Int", 1)
- , sv: DllCall("LoadKeyboardLayout", "Str", "0000041D", "Int", 1) }
+ , sv: DllCall("LoadKeyboardLayout", "Str", "0000041D", "Int", 1) }
ShowLayout()
;; -> library
ShowLayout(hwnd := "")
{
- global layouts
- f := A_FormatInteger
- SetFormat, Integer, H
- if (hwnd = "")
- WinGet, hwnd, id, A
- thread := DllCall("GetWindowThreadProcessId", "UInt",hwnd, "UInt",0)
- layout := DllCall("user32.dll\GetKeyboardLayout", "UInt",thread, "UInt")
- for k, v in layouts
- {
- if (layout = v)
- {
- if (FileExist(k ".ico"))
- Menu, Tray, Icon, %k%.ico
- break
- }
- }
- SetFormat, Integer, %f%
+ global layouts
+ f := A_FormatInteger
+ SetFormat, Integer, H
+ if (hwnd = "")
+ WinGet, hwnd, id, A
+ thread := DllCall("GetWindowThreadProcessId", "UInt",hwnd, "UInt",0)
+ layout := DllCall("user32.dll\GetKeyboardLayout", "UInt",thread, "UInt")
+ for k, v in layouts
+ {
+ if (layout = v)
+ {
+ if (FileExist(k ".ico"))
+ Menu, Tray, Icon, %k%.ico
+ break
+ }
+ }
+ SetFormat, Integer, %f%
}
;; Update layout display on window change -------------------------------------
@@ -46,11 +46,11 @@ ShowLayout(hwnd := "")
LayoutWindowMessage(wParam, lParam)
{
- if (wParam = 4 or wParam = 32772) ; HSHELL_WINDOW_ACTIVATED | HSHELL_RUDEAPPACTIVATED
- {
- ShowLayout(lParam)
- WinSet, AlwaysOnTop, On, OSD
- }
+ if (wParam = 4 or wParam = 32772) ; HSHELL_WINDOW_ACTIVATED | HSHELL_RUDEAPPACTIVATED
+ {
+ ShowLayout(lParam)
+ WinSet, AlwaysOnTop, On, OSD
+ }
}
;; -> init
@@ -67,6 +67,6 @@ OnMessage(0x404, "NotifyIcon")
NotifyIcon(wParam, lParam)
{
- if (lParam = 0x202) ; WM_LBUTTONUP
- Run, % "Rundll32 Shell32.dll,Control_RunDLL input.dll,,{C07337D3-DB2C-4D0B-9A93-B722A6C106E2}"
+ if (lParam = 0x202) ; WM_LBUTTONUP
+ Run, % "Rundll32 Shell32.dll,Control_RunDLL input.dll,,{C07337D3-DB2C-4D0B-9A93-B722A6C106E2}"
}