카테고리 없음

오토핫키 한영 전환

do121 2023. 2. 2. 08:03

IME_CHECK(WinTitle)
{
    WinGet,hWnd,ID,%WinTitle%
    Return Send_ImeControl(ImmGetDefaultIMEWnd(hWnd),0x005,"")
}



Send_ImeControl(DefaultIMEWnd, wParam, lParam)
{
    DetectSave := A_DetectHiddenWindows      
    DetectHiddenWindows,ON                          

     SendMessage 0x283, wParam,lParam,,ahk_id %DefaultIMEWnd%
    if (DetectSave <> A_DetectHiddenWindows)
        DetectHiddenWindows,%DetectSave%
    return ErrorLevel
}



ImmGetDefaultIMEWnd(hWnd)
{
    return DllCall("imm32\ImmGetDefaultIMEWnd", Uint,hWnd, Uint)
}


^space::
    ret := IME_CHECK("A")
    if %ret% = 0                 ; 0 :English
    {
        Send, {vk15sc138}  
    }
return



+space::
    ret := IME_CHECK("A")
    if %ret% <> 0               ; 1 Hangul
    {
        Send, {vk15sc138}  
     }
return