Skip to content

Instantly share code, notes, and snippets.

@urouro
Created October 30, 2015 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save urouro/4539b4194a4fafef9a40 to your computer and use it in GitHub Desktop.
Save urouro/4539b4194a4fafef9a40 to your computer and use it in GitHub Desktop.
Windows 8 + Google IME + AutoHotKey / 左Altを押したときに英数入力、右Altを押したときに日本語入力できるようにする
;
; rf. http://qiita.com/844196/items/9fc1cd8470a9ad9c3a69#2-3
;
IME_ON(hWindow, IsON)
{
; WM_IME_CONTROL = 0x0283
; IMC_SETOPENSTATUS = 0x0006
bufCurrentDetectMode := A_DetectHiddenWindows
DetectHiddenWindows, On
buf := DllCall("user32.dll\SendMessageA", "UInt", DllCall("imm32.dll\ImmGetDefaultIMEWnd", "Uint",hWindow), "UInt", 0x0283, "Int", 0x0006, "Int", IsON)
DetectHiddenWindows, %bufCurrentDetectMode%
Return buf
}
LAlt::IME_ON(WinExist("A"), False)
RAlt::IME_ON(WinExist("A"), True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment