自分好みの Auto Hot Key の設定

自分好みの Auto Hot Key の設定.記録用のページ.

.ahk ファイルの保存は,utf-8 Bom付が推奨.

#NoEnv
#UseHook
#HotkeyInterval, 2000
#MaxHotkeysPerInterval, 200
Process, Priority,, Realtime
SendMode, Input

F13 & H::Send,{Blind}{Left}
F13 & J::Send,{Blind}{Down}
F13 & K::Send,{Blind}{Up}
F13 & L::Send,{Blind}{Right}

F13 & A::Send,{Blind}{Home}
F13 & E::Send,{Blind}{End}

F13 & U::Send,{Blind}{BS}
F13 & D::Send,{Blind}{Del}

F13 & Space::Send,{Blind}{Enter}

vk1D::Send,{vk1D}
vk1D & H::Send,{Blind}{Left}
vk1D & J::Send,{Blind}{Down}
vk1D & K::Send,{Blind}{Up}
vk1D & L::Send,{Blind}{Right}

vk1D & A::Send,{Blind}{Home}
vk1D & E::Send,{Blind}{End}

vk1D & U::Send,{Blind}{BS}
vk1D & D::Send,{Blind}{Del}

vk1D & Space::Send,{Blind}{Enter}

NumpadHome::Send,{Home}{BS}{Space}

; mouse jesture
RButtonDown := 0
RButton::
	global RButtonDown
	RButtonDown := 1

	GetMouseGesture(True)

	While (RButtonDown = 1) {
		;ToolTip % MG := GetMouseGesture()
		MG := GetMouseGesture()
		Sleep 150
	}

	; U, D, R, L, E, Q, Z, C の組み合わせの関数でジェスチャー作成
	if (IsFunc(MG)) {
		%MG%()
	} else {
		Send {RButton}
	}

	;ToolTip
	GetMouseGesture(True)
Return

RButton Up::
	global RButtonDown
	RButtonDown := 0
Return

GetMouseGesture(reset := false){
	Static
	mousegetpos,xpos2, ypos2
	dx:=xpos2-xpos1,dy:=ypos1-ypos2
	,dx>0 ? (dy > 0 ? (track:="E") : (track:="C")) : (dy > 0? (track:="Q") : (track:="Z"))
	,abs(dy) >= 2.4142*abs(dx) ? (dy > 0 ? (track:="U") : (track:="D")) : "" ;track is up or down
	,abs(dx) >= 2.4142*abs(dy) ? (dx > 0 ? (track:="R") : (track:="L")) : "" ;track is left or right
	,abs(dy)<4 and abs(dx)<4 ? (track := "") : ""	;not tracking at all if no significant change in x or y
	,xpos1:=xpos2,ypos1:=ypos2
	,track<>SubStr(gesture, 0, 1) ? (gesture := gesture . track) : ""	;ignore track if not changing since previous track
	,gesture := reset ? "" : gesture
	Return gesture
}

R(){
	Send, {Blind}{Right}
}
L(){
	Send, {Blind}{Left}
}
C(){
	Send, ^{PgUp}
}
Z(){
	Send, ^{PgDn}
}
E(){
	Send, !{Left}
}
Q(){
	Send, !{Right}
}
U(){
	Send, !{Up}
}
D(){
	Send, {Blind}{Space}
}
DU(){
	Send, ^w
}
DUD(){
	Send, !{F4}
}
ZQ(){
	Send, ^#{Right}
}
CE(){
	Send, ^#{Left}
}
DL(){
	Send, {Blind}{Enter}
}
RU(){
	Send, #{Right}
}
LU(){
	Send, #{Left}
}
UR(){
	Send, #{Up}
}
DR(){
	Send, #{Down}
}
QE(){
	Send, {Esc}
}