ProcessSetPriority "High"
SetMouseDelay -1
SendMode "Input"
A_MaxHotkeysPerInterval := 200
InstallKeybdHook
#UseHook
CoordMode "Mouse", "Window"
;--------------------------------------------------------
; ^Ctrl, !Alt, +Shif, #Win
;--------------------------------------------------------
; "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}"
>+7::Send "{Home}"
>+8::Send "{End}"
>+9::Send "{.}"
>+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 & 2::Send "{F2}"
sc07B & q::Send "{Esc}"
sc07B & w::Send "#!{Space}" ; PowerToys
sc07B & sc079::Send "!{Space}" ; CLaunch
;--------------------------------------------------------
~^c::
{
If (A_PriorHotkey = A_ThisHotkey && 500 > A_TimeSincePriorHotkey)
{
Send "{End}+{Home}^c"
}
}
;--------------------------------------------------------
sc079::Ctrl ; SpreadSheet対策
sc079 & 1::MyWinMove(-1)
sc079 & 2::MyWinMove(1)
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 & Ctrl::AltTab
sc079 & a::Send "^+{Tab}" ; 前のタブ
sc079 & s::Send "^{Tab}" ; 次のタブ
sc079 & d::Send "^+t" ; 再び開く
sc079 & f::Send "^{F5}" ; 更新
sc079 & g::Send "!+g" ; Alt+Shift+G / Chrome
sc079 & z::Send "!+z" ; Alt+Shift+Z / Chrome
mm := []
If (MonitorGetCount() = 3)
{
MonitorGetWorkArea(1,&L,&T,&R,&B)
mm.Push({L:L,T:T,R:R,B:B})
MonitorGetWorkArea(2,&L,&T,&R,&B)
mm.Push({L:L,T:T,R:R,B:B})
MonitorGetWorkArea(3,&L,&T,&R,&B)
mm.Push({L:L,T:T,R:R,B:B})
}
Else
{
MonitorGetWorkArea(1,&L,&T,&R,&B)
mm.Push({L:L,T:T,R:R,B:B})
}
MyWinMove(f)
{
this_id := WinGetID("A")
If (WinGetMinMax(this_id) = 1)
{
WinRestore(this_id)
}
WinGetPos(&x,&y,&w,&h,this_id)
ii := 1
For i, m in mm
{
If (m.L = x || m.L + 7 = x)
{
ii := i + f
If (ii > mm.Length)
{
ii := 1
}
Else If (ii < 1)
{
ii := mm.Length
}
break
}
}
If (isOverflowProcess())
{
WinMove((mm[ii].L+7),(mm[ii].T+7),,,this_id)
WinMove(,,(mm[ii].R - mm[ii].L)-14,(mm[ii].B - mm[ii].T-14),this_id)
}
Else
{
WinMove((mm[ii].L),(mm[ii].T+7),,,this_id)
WinMove(,,(mm[ii].R - mm[ii].L),(mm[ii].B - mm[ii].T-7),this_id)
}
}
isOverflowProcess()
{
processName := WinGetProcessName("A")
if (processName = "Obsidian.exe" ||
processName = "Mattermost.exe" ||
processName = "PDFelement.exe" ||
processName = "LINE.exe" ||
processName = "Code.exe")
{
Return true
}
Else
{
Return false
}
}
sc079 & c::
{
static keyDownCount
If (A_PriorHotkey = A_ThisHotkey && 500 > A_TimeSincePriorHotkey)
{
keyDownCount += 1
If (keyDownCount > 1)
{
keyDownCount := 0
}
}
Else
{
keyDownCount := 0
}
this_id := WinGetID("A")
If (WinGetMinMax(this_id) = 1)
{
WinRestore(this_id)
}
WinGetPos(&x,&y,&w,&h,this_id)
If (keyDownCount = 1)
{
For i, m in mm
{
If (m.L = x)
{
WinMove(x + w,,,,this_id)
Break
}
Else If (m.L + 7 = x)
{
WinMove(x + w + 14,,,,this_id)
Break
}
}
Return
}
For i, m in mm
{
If (m.L = x || m.L + 7 = x)
{
If (m.R - m.L = w)
{
WinMove(,,w/2,,this_id)
}
If (m.R - m.L = w + 14)
{
WinMove(,,(w - 14) / 2,,this_id)
}
Break
}
}
}
sc079 & v::
{
static keyDownCount
If (A_PriorHotkey = A_ThisHotkey && 500 > A_TimeSincePriorHotkey)
{
keyDownCount += 1
If (keyDownCount > 1)
{
keyDownCount := 0
}
}
Else
{
keyDownCount := 0
}
this_id := WinGetID("A")
If (keyDownCount = 0)
{
If (WinGetMinMax(this_id) = 1)
{
WinRestore(this_id)
WinMove(,,1200,750,this_id)
}
WinGetPos(&x,&y,,,this_id)
if (x = -SysGet(16) or x = 0) ; sc079&Cサイズ用
{
WinMove(,,1200,750,this_id)
}
WinGetPos(,,&w,&h,this_id)
MouseMove(w/2, 9) ; 150%
}
Else If (keyDownCount = 1)
{
WinGetPos(,,&w,&h,this_id)
MouseMove(w-5, h-5)
}
}
sc079 & ^::Send "^{`^}" ; Ctrl+^ / ShareX
sc079 & \::Send "^{`\}" ; Ctrl+\ / ShareX
;--------------------------------------------------------
sc079 & WheelUp::Send "{PgUp}"
sc079 & WheelDown::Send "{PgDn}"
+WheelUp::Send "{WheelLeft}"
+WheelDown::Send "{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 Code.exe")
sc079 & e::Send "^{F4}" ; 閉じる
sc079 & a::Send "^{PgUp}" ; 前のタブ
sc079 & s::Send "^{PgDn}" ; 次のタブ
;--------------------------------------------------------
#HotIf WinActive("ahk_exe excel.exe")
sc079 & a::Send "^{PgUp}" ; 前のタブ
sc079 & s::Send "^{PgDn}" ; 次のタブ
sc079 & f::Send "^+{L}" ; オートフィルタ
sc079 & v::
{
Send "!h"
Sleep 100
Send "s"
Sleep 100
Send "u"
}
+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