-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathCapsLockIME.ahk
More file actions
32 lines (28 loc) · 952 Bytes
/
CapsLockIME.ahk
File metadata and controls
32 lines (28 loc) · 952 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; Using CapsLock LED for other purposes
; http://superuser.com/questions/613747/using-capslock-led-for-other-purposes
#Include led.ahk
; I don't know kbd, so try all
_KeyboardLED(Cmd) {
Loop, 6 {
KeyboardLED(4, Cmd, A_Index-1)
}
}
; http://www.autohotkey.co.kr/cgi/board.php?bo_table=script&wr_id=357
IME_CHECK(WinTitle) {
WinGet,hWnd,ID,%WinTitle%
DefaultIMEWnd := DllCall("imm32\ImmGetDefaultIMEWnd", Uint, hWnd, Uint)
DetectSave := A_DetectHiddenWindows
DetectHiddenWindows,ON
SendMessage 0x283, 0x005, "", , ahk_id %DefaultIMEWnd%
if (DetectSave <> A_DetectHiddenWindows)
DetectHiddenWindows,%DetectSave%
return ErrorLevel
}
CapsLock::
Send, {vk15sc138}
If IME_CHECK("A") = 1 ; If Korean,
_KeyboardLED("on")
Else
_KeyboardLED("off")
Return