ProcessSetPriority "High"
SetMouseDelay -1
SendMode "Input"
A_MaxHotkeysPerInterval := 200
InstallKeybdHook
#UseHook
CoordMode "Mouse", "Window"
;--------------------------------------------------------
; "C:\Program Files (x86)\Google\Google Japanese Input\GoogleIMEJaTool.exe" -mode=config_dialog
; Hiragana>IMEを有効化
; Muhenkan>IMEを無効化
; エントリーを削除
; Henkan
; Shift Henkan
; Shift Muhenkan
;--------------------------------------------------------
>+4::Send "{Enter}"
>+5::Send "{Tab}"
>+7::Send "{Home}"
>+8::Send "{End}"
>+q::Send "{&}"
>+w::Send "{'}"
>+a::Send "{#}"
>+s::Send "{~}"
>+z::Send "{^}"
>+x::Send "{$}"
>+u::Send "{|}"
>+i::Send "{\}"
>+o::Send "{@}"
>+p::Send "{`%}"
>+n::Send "{(}"
>+m::Send "{)}"
>+h::Send "{Left}"
>+j::Send "{Down}"
>+k::Send "{Up}"
>+l::Send "{Right}"
>+Backspace::Send "{Delete}"
;--------------------------------------------------------
~sc07B::
{
If (A_PriorHotkey = A_ThisHotkey && 500 > A_TimeSincePriorHotkey)
{
Send "{sc070}"
}
}
sc07B & 1::Send "{F12}"
sc07B & 2::Send "{F2}"
sc07B & q::Send "{Esc}"
sc07B & w::Send "{LWin}"
sc07B & e::Send "#{r}"
;--------------------------------------------------------
~^c::
{
If (A_PriorHotkey = A_ThisHotkey && 500 > A_TimeSincePriorHotkey)
{
Send "{End}+{Home}^c"
}
}
;--------------------------------------------------------
sc079::Ctrl ; SpreadSheet対策
sc079 & 3::Send "^{Home}" ; Ctrl+Home
sc079 & 4::Send "^{End}" ; Ctrl+End
sc079 & q::Send "!{Left}" ; 戻る
sc079 & w::Send "!{Right}" ; 進む
sc079 & e::Send "^w" ; 閉じる
sc079 & r::Send "!+r" ; Alt+Shift+R / TabsToWindow
sc079 & Ctrl::AltTab
Ctrl & sc079::Send "#{Tab}"
sc079 & a::Send "^+{Tab}" ; 前のタブ
sc079 & s::Send "^{Tab}" ; 次のタブ
sc079 & d::Send "^+t" ; 再び開く
sc079 & f::Send "^{F5}" ; 更新
sc079 & g::Send "!+g" ; Alt+Shift+G / MergeTabs
sc079 & z::Send "!+z" ; Alt+Shift+Z / CloseRightTabs
mm := []
Loop MonitorGetCount()
{
if MonitorGetWorkArea(A_Index,&L,&T,&R,&B)
{
mm.Push({L:L,T:T,R:R,B:B})
}
}
sc079 & c::
{
global mm
static keyDownCount1
If (A_PriorHotkey = A_ThisHotkey && 500 > A_TimeSincePriorHotkey)
{
keyDownCount1 += 1
If (keyDownCount1 > MonitorGetCount() - 1)
{
keyDownCount1 := 0
}
}
Else
{
keyDownCount1 := 0
}
x := keyDownCount1 + 1
this_id := WinGetID("A")
If (WinGetMinMax(this_id) = 1)
{
WinRestore(this_id)
}
WinMove((mm[x].L),(mm[x].T),,,this_id) ; 拡大縮小対策
WinMove(,,(mm[x].R - mm[x].L),(mm[x].B - mm[x].T),this_id)
}
sc079 & v::
{
static keyDownCount2
If (A_PriorHotkey = A_ThisHotkey && 500 > A_TimeSincePriorHotkey)
{
keyDownCount2 += 1
If (keyDownCount2 > 1)
{
keyDownCount2 := 0
}
}
Else
{
keyDownCount2 := 0
}
this_id := WinGetID("A")
If (keyDownCount2 = 0)
{
If (WinGetMinMax(this_id) = 1)
{
WinRestore(this_id)
WinMove(,,1100,750,this_id)
}
WinGetPos(&x,&y,,,this_id)
if (x = -SysGet(16) or x = 0)
{
WinMove(,,1100,750,this_id)
}
WinGetPos(,,&w,&h,this_id)
MouseMove(w/2, 9) ; 150%
}
Else If (keyDownCount2 = 1)
{
WinGetPos(,,&w,&h,this_id)
MouseMove(w-5, h-5)
}
}
;--------------------------------------------------------
sc079 & WheelUp::Send "{PgUp}"
sc079 & WheelDown::Send "{PgDn}"
+WheelUp::WheelLeft
+WheelDown::WheelRight
MButton::
{
MouseGetPos(&mx,&my,&id)
if InStr(WinGetClass(id), "Chrome")
{
MouseClick "R"
}
else
{
MouseClick "M"
}
}
RButton::
{
MouseGetPos(&mx,&my,&id)
if InStr(WinGetClass(id), "Chrome")
{
MouseClick "M"
}
else
{
MouseClick "R"
}
}
;--------------------------------------------------------
#HotIf WinActive("ahk_exe chrome.exe")
+Space::
{
this_id := WinGetID("A")
imestate := DllCall("user32.dll\SendMessageW", "Ptr", DllCall("imm32.dll\ImmGetDefaultIMEWnd", "Ptr", this_id), "Ptr", 0x0283, "Ptr", 0x0005, "Ptr", 0)
if (imestate = 1)
{
Send "{sc07B}"
}
Send "+{Space}"
}
;--------------------------------------------------------
#HotIf WinActive("ahk_exe excel.exe")
sc079 & a::Send "^{PgUp}" ; 前のタブ
sc079 & s::Send "^{PgDn}" ; 次のタブ
sc079 & f::Send "^+{L}" ; オートフィルタ
+Space::
{
Send "{sc07B}"
Send "+{Space}"
}
MButton::
{
MouseClick "L"
Send "{F4}"
}
;--------------------------------------------------------
#HotIf WinActive("ahk_exe mpc-be64.exe")
sc079 & a::Send "^{PgUp}" ; 前のタブ
sc079 & s::Send "^{PgDn}" ; 次のタブ
w::Send "{Numpad1 10}"
e::Send "^{Numpad2 10}"
r::Send "{Numpad9 10}"
s::Send "^{Numpad6 10}"
d::Send "^{Numpad8 10}"
f::Send "^{Numpad4 10}"
c::Send "{Numpad5}"
v::Send "!{Numpad3}"
#HotIf