旧:いま使っているAHKスクリプト(1本にまとめたもの)
code:user.ahk
GroupAdd, kuntab, ahk_class MozillaWindowClass
GroupAdd, kuntab, ahk_class Chrome_WidgetWin_0
GroupAdd, kuntab, ahk_class Chrome_WidgetWin_1
GroupAdd, kuntab, ahk_class QWidget
GroupAdd, desktop, ahk_class Progman
GroupAdd, desktop, ahk_class WorkerW
GroupAdd, game, ahk_class UnityWndClass
GroupAdd, game, ahk_class Notepad
GroupAdd, game, ahk_exe Game.exe
SetCapsLockState, AlwaysOff
; SetKeyDelay, 0
ShowMessage("AHK-funkcioj estas aktivaj")
return
;#IfWinActive ahk_class MozillaWindowClass || #IfWinActive ahk_class Chrome_WidgetWin_1 || #IfWinActive ahk_class Chrome_WidgetWin_0 ;
;Browser_Search::Esc
;NumpadHome::return
;NumpadUp::Volume_Down
;NumpadPgUp::Volume_Up
;Browser_Stop::!F4
;Browser_Refresh::Delete
;
;Browser_Home::Tab
;NumpadLeft::
; Send ^.
; Sleep, 250
; Send p
;Return
;NumpadClear::Return
;NumpadRight::Up
;NumpadAdd::[
;NumpadSub::]
;
;NumpadEnd::Backspace
;NumpadDown::Left
;NumpadPgDn::Down
;NumpadDiv::Right
;NumpadMult::Enter
;
;NumpadIns::z
;NumpadDel::x
;NumpadEnter::c
;Browser_Favorites::Space
;
;^NumpadIns::^z
;^NumpadDel::^x
;^NumpadEnter::^c
;^Browser_Favorites::^v
;
;
;#IfWinActive ahk_class PotPlayer64
;
;Browser_Search::Esc
;NumpadHome::Return
;NumpadUp::Volume_Down
;NumpadPgUp::Volume_Up
;Browser_Stop::!F4
;Browser_Refresh::Delete
;
;Browser_Home::Tab
;NumpadLeft::p
;NumpadClear::Return
;NumpadRight::Up
;NumpadAdd::[
;NumpadSub::]
;
;NumpadEnd::Backspace
;NumpadDown::Left
;NumpadPgDn::Down
;NumpadDiv::Right
;NumpadMult::Enter
;
;NumpadIns::z
;NumpadDel::x
;NumpadEnter::c
;Browser_Favorites::Space
;
;^NumpadIns::^z
;^NumpadDel::^x
;^NumpadEnter::^c
;^Browser_Favorites::^v
;
;#IfWinActive
;
;Browser_Search::Esc
;NumpadHome::return
;NumpadUp::Volume_Down
;NumpadPgUp::Volume_Up
;Browser_Stop::!F4
;Browser_Refresh::Delete
;
;Browser_Home::Tab
;NumpadLeft::p
;NumpadClear::Return
;NumpadRight::Up
;NumpadAdd::[
;NumpadSub::]
;
;NumpadEnd::Backspace
;NumpadDown::Left
;NumpadPgDn::Down
;NumpadDiv::Right
;NumpadMult::Enter
;
;NumpadIns::z
;NumpadDel::x
;NumpadEnter::c
;Browser_Favorites::Space
;
;^NumpadIns::^z
;^NumpadDel::^x
;^NumpadEnter::^c
;^Browser_Favorites::^v
;
;^NumpadSub::^y
MButton::
;$mbutton:: ;
; while GetKeyState("mbutton", "P") ; While mouse button is being held:
; { } ; Don't do anything - After it has been released:
MouseGetPos,,,hwnd,ctrl,2 ;中ボタンをクリックした位置にあるウィンドウをアクティブ化
WinActivate, ahk_id %hwnd%
IfWinActive, ahk_exe Simplenote.exe ;SimplenoteもChromeのWindowクラスが出るので区別
{
WinClose, ahk_id %hwnd%
ShowMessage("Simplenote estis fermita")
return
}
IfWinActive, ahk_class TablacusExplorer ;マウスジェスチャ機能に任せる
{
Send, {MButton}
return
}
IfWinActive, ahk_group kuntab
{
Send,{LButton} ;ちゃんと選択しないとアクティブタブが閉じてしまうのでクリック
Send,^w ;タブ閉じショートカット ctrl+w を発行
ShowMessage("Langeto estis fermita")
return
}
IfWinActive, ahk_class Shell_TrayWnd ;タスクバーなら 7+ Taskbar Tweaker に任せるので中ボタンを送る
{
Send, {MButton}
return
}
IfWinActive, ahk_group desktop
{
Reload
return
}
WinGetTitle, Title, A
WinClose, ahk_id %hwnd%
ShowMessage(Title . " estis fermita")
return
c::
Thread, Interrupt, 250
KeyWait,c,T0.25
If(ErrorLevel)
{
Send, ĉ
KeyWait,c
Return
}
Send, c
Return
+c::
Thread, Interrupt, 250
KeyWait,c,T0.25
If(ErrorLevel)
{
Send, Ĉ
KeyWait,c
Return
}
Send, C
Return
g::
Thread, Interrupt, 250
KeyWait,g,T0.25
If(ErrorLevel)
{
Send, ĝ
KeyWait,g
Return
}
Send, g
Return
+g::
Thread, Interrupt, 250
KeyWait,g,T0.25
If(ErrorLevel)
{
Send, Ĝ
KeyWait,g
Return
}
Send, G
Return
h::
Thread, Interrupt, 250
KeyWait,h,T0.25
If(ErrorLevel)
{
Send, ĥ
KeyWait,h
Return
}
flag = h
Send, h
Return
+h::
Thread, Interrupt, 250
KeyWait,h,T0.25
If(ErrorLevel)
{
Send, Ĥ
KeyWait,h
Return
}
Send, H
Return
j::
Thread, Interrupt, 250
KeyWait,j,T0.25
If(ErrorLevel)
{
Send, ĵ
KeyWait,j
Return
}
Send, j
Return
+j::
Thread, Interrupt, 250
KeyWait,j,T0.25
If(ErrorLevel)
{
Send, Ĵ
KeyWait,j
Return
}
Send, J
Return
s::
Thread, Interrupt, 250
KeyWait,s,T0.25
If(ErrorLevel)
{
Send, ŝ
KeyWait,s
Return
}
Send, s
flag = s
Return
+s::
Thread, Interrupt, 250
KeyWait,s,T0.25
If(ErrorLevel)
{
Send, Ŝ
KeyWait,s
Return
}
Send, S
flag = "+s"
Return
w::
Thread, Interrupt, 250
KeyWait,w,T0.25
If(ErrorLevel)
{
Send, ŭ
KeyWait,w
Return
}
Send,w
Return
+w::
Thread, Interrupt, 250
KeyWait,w,T0.25
If(ErrorLevel)
{
Send, Ŭ
KeyWait,w
Return
}
Send, W
Return
u::
Thread, Interrupt, 250
KeyWait,u,T0.25
If(ErrorLevel)
{
Send, ŭ
KeyWait,u
Return
}
Send, u
flag = u
Return
+u::
Thread, Interrupt, 250
KeyWait,u,T0.25
If(ErrorLevel)
{
Send, Ŭ
KeyWait,u
Return
}
Send, U
flag = "+u"
Return
a::
Thread, Interrupt, 250
KeyWait,a,T0.25
send, a
flag = a
return
e::
Thread, Interrupt, 250
KeyWait,e,T0.25
If(ErrorLevel)
{
Send, {enter}
ShowMessage("Enter")
KeyWait,e
Return
}
Send, e
flag = e
Return
i::
Thread, Interrupt, 250
KeyWait,i,T0.25
Send, i
flag = i
Return
o::
Thread, Interrupt, 250
KeyWait,o,T0.25
Send, o
flag = o
Return
+a::
Thread, Interrupt, 250
KeyWait,a,T0.25
Send, A
flag = "+a"
Return
+e::
Thread, Interrupt, 250
KeyWait,e,T0.25
Send, E
flag = "+e"
Return
+i::
Thread, Interrupt, 250
KeyWait,i,T0.25
Send, I
flag = "+i"
Return
+o::
Thread, Interrupt, 250
KeyWait,o,T0.25
Send, O
flag = "+o"
Return
l::
Thread, Interrupt, 250
KeyWait,l,T0.25
Send, l
flag = l
Return
+l::
Thread, Interrupt, 250
KeyWait,l,T0.25
Send, L
flag = "+l"
Return
r::
Thread, Interrupt, 250
KeyWait,r,T0.25
Send, r
flag = r
Return
+r::
Thread, Interrupt, 250
KeyWait,r,T0.25
Send, R
flag = "+r"
Return
n::
Thread, Interrupt, 250
KeyWait,n,T0.25
Send, n
flag = n
Return
t::
Thread, Interrupt, 250
KeyWait,t,T0.25
FormatTime, CurrentTime,, hh:mm
If(ErrorLevel)
{
SendInput %CurrentTime%
KeyWait,t
Return
}
flag = t
Send, t
Return
m::
Thread, Interrupt, 250
KeyWait,m,T0.25
Send, m
flag = m
Return
1::
Thread, Interrupt, 250
KeyWait,1,T0.25
If(ErrorLevel)
{
If flag = a
{
Send, {Backspace}ā
flag =
KeyWait,1
Return
}
If flag = e
{
Send, {Backspace}ē
flag =
KeyWait,1
Return
}
If flag = i
{
Send, {Backspace}ī
flag =
KeyWait,1
Return
}
If flag = o
{
Send, {Backspace}ō
flag =
KeyWait,1
Return
}
If flag = u
{
Send, {Backspace}ū
flag =
KeyWait,1
Return
}
If flag = ü
{
Send, {Backspace}ǖ
flag =
KeyWait,1
Return
}
If flag = "+a"
{
Send, {Backspace}Ā
flag =
KeyWait,1
Return
}
If flag = "+e"
{
Send, {Backspace}Ē
flag =
KeyWait,1
Return
}
If flag = "+i"
{
Send, {Backspace}Ī
flag =
KeyWait,1
Return
}
If flag = "+o"
{
Send, {Backspace}Ō
flag =
KeyWait,1
Return
}
If flag = "+u"
{
Send, {Backspace}Ū
flag =
KeyWait,1
Return
}
If flag = "+ü"
{
Send, {Backspace}Ǖ
flag =
KeyWait,1
Return
}
If flag = l
{
Send, {Backspace}ḹ
KeyWait,1
Return
}
If flag = "l."
{
Send, {Backspace}ḹ
KeyWait,1
Return
}
If flag = r
{
Send, {Backspace}ṝ
KeyWait,1
Return
}
If flag = "r."
{
Send, {Backspace}ṝ
KeyWait,1
Return
}
KeyWait,1
Return
}
Send,1
Return
2::
Thread, Interrupt, 250
KeyWait,2,T0.25
If(ErrorLevel)
{
If flag = a
{
Send, {Backspace}á
flag =
KeyWait,2
Return
}
If flag = e
{
Send, {Backspace}é
flag =
KeyWait,2
Return
}
If flag = i
{
Send, {Backspace}í
flag =
KeyWait,2
Return
}
If flag = o
{
Send, {Backspace}ó
flag =
KeyWait,2
Return
}
If flag = u
{
Send, {Backspace}ú
flag =
KeyWait,2
Return
}
If flag = ü
{
Send, {Backspace}ǘ
flag =
KeyWait,2
Return
}
If flag = s
{
Send, {Backspace}ś
KeyWait,2
Return
}
If flag = "+a"
{
Send, {Backspace}Á
flag =
KeyWait,2
Return
}
If flag = "+e"
{
Send, {Backspace}É
flag =
KeyWait,2
Return
}
If flag = "+i"
{
Send, {Backspace}Í
flag =
KeyWait,2
Return
}
If flag = "+o"
{
Send, {Backspace}Ó
flag =
KeyWait,2
Return
}
If flag = "+u"
{
Send, {Backspace}Ú
flag =
KeyWait,2
Return
}
If flag = "+ü"
{
Send, {Backspace}Ǘ
flag =
KeyWait,2
Return
}
If flag = "+s"
{
Send, {Backspace}Ś
KeyWait,2
Return
}
Return
}
Send,2
Return
3::
Thread, Interrupt, 250
KeyWait,3,T0.25
If(ErrorLevel)
{
If flag = a
{
Send, {Backspace}ǎ
flag =
KeyWait,3
Return
}
If flag = e
{
Send, {Backspace}ě
flag =
KeyWait,3
Return
}
If flag = i
{
Send, {Backspace}ǐ
flag =
KeyWait,3
Return
}
If flag = o
{
Send, {Backspace}ǒ
flag =
KeyWait,3
Return
}
If flag = u
{
Send, {Backspace}ǔ
flag =
KeyWait,3
Return
}
If flag = ü
{
Send, {Backspace}ǚ
flag =
KeyWait,3
Return
}
If flag = "+a"
{
Send, {Backspace}Ǎ
flag =
KeyWait,3
Return
}
If flag = "+e"
{
Send, {Backspace}Ě
flag =
KeyWait,3
Return
}
If flag = "+i"
{
Send, {Backspace}Ǐ
flag =
KeyWait,3
Return
}
If flag = "+o"
{
Send, {Backspace}Ǒ
flag =
KeyWait,3
Return
}
If flag = "+u"
{
Send, {Backspace}Ǔ
flag =
KeyWait,3
Return
}
If flag = "+ü"
{
Send, {Backspace}Ǚ
flag =
KeyWait,3
Return
}
Return
}
Send,3
Return
4::
Thread, Interrupt, 250
KeyWait,4,T0.25
If(ErrorLevel)
{
If flag = a
{
Send, {Backspace}à
flag =
KeyWait,4
Return
}
If flag = e
{
Send, {Backspace}è
flag =
KeyWait,4
Return
}
If flag = i
{
Send, {Backspace}ì
flag =
KeyWait,4
Return
}
If flag = o
{
Send, {Backspace}ò
flag =
KeyWait,4
Return
}
If flag = u
{
Send, {Backspace}ù
flag =
KeyWait,4
Return
}
If flag = ü
{
Send, {Backspace}ǜ
flag =
KeyWait,4
Return
}
If flag = "+a"
{
Send, {Backspace}À
flag =
KeyWait,4
Return
}
If flag = "+e"
{
Send, {Backspace}È
flag =
KeyWait,4
Return
}
If flag = "+i"
{
Send, {Backspace}Ì
flag =
KeyWait,4
Return
}
If flag = "+o"
{
Send, {Backspace}Ò
flag =
KeyWait,4
Return
}
If flag = "+u"
{
Send, {Backspace}Ù
flag =
KeyWait,4
Return
}
If flag = "+ü"
{
Send, {Backspace}Ǜ
flag =
KeyWait,4
Return
}
Return
}
Send,4
Return
5::
Thread, Interrupt, 250
KeyWait,5,T0.25
If(ErrorLevel)
{
If flag = a
{
Send, {Backspace}ä
flag =
KeyWait,5
Return
}
If flag = e
{
Send, {Backspace}ë
flag =
KeyWait,5
Return
}
If flag = i
{
Send, {Backspace}ï
flag =
KeyWait,5
Return
}
If flag = o
{
Send, {Backspace}ö
flag =
KeyWait,5
Return
}
If flag = u
{
Send, {Backspace}ü
flag = ü
KeyWait,5
Return
}
If flag = "+a"
{
Send, {Backspace}Ä
flag =
KeyWait,5
Return
}
If flag = "+e"
{
Send, {Backspace}Ë
flag =
KeyWait,5
Return
}
If flag = "+i"
{
Send, {Backspace}Ï
flag =
KeyWait,5
Return
}
If flag = "+o"
{
Send, {Backspace}Ö
flag =
KeyWait,5
Return
}
If flag = "+u"
{
Send, {Backspace}Ü
flag = "+ü"
KeyWait,5
Return
}
Return
}
Send,5
Return
6::
Thread, Interrupt, 250
KeyWait,6,T0.25
If(ErrorLevel)
{
If flag = a
{
Send, {Backspace}â
flag =
KeyWait,6
Return
}
If flag = e
{
Send, {Backspace}ê
flag =
KeyWait,6
Return
}
If flag = i
{
Send, {Backspace}î
flag =
KeyWait,6
Return
}
If flag = o
{
Send, {Backspace}ô
flag =
KeyWait,6
Return
}
If flag = u
{
Send, {Backspace}û
flag =
KeyWait,6
Return
}
If flag = "+a"
{
Send, {Backspace}Â
flag =
KeyWait,6
Return
}
If flag = "+e"
{
Send, {Backspace}Ê
flag =
KeyWait,6
Return
}
If flag = "+i"
{
Send, {Backspace}Î
flag =
KeyWait,6
Return
}
If flag = "+o"
{
Send, {Backspace}Ô
flag =
KeyWait,6
Return
}
If flag = "+u"
{
Send, {Backspace}Û
flag =
KeyWait,6
Return
}
Return
}
Send,6
Return
7::
Thread, Interrupt, 250
KeyWait,7,T0.25
If(ErrorLevel)
{
If flag = n
{
Send, {Backspace}ñ
flag =
KeyWait,7
Return
}
Return
}
Send,7
Return
9::
Thread, Interrupt, 250
KeyWait,9,T0.25
If(ErrorLevel)
{
If flag = n
{
Send, {Backspace}ṅ
flag =
KeyWait,9
Return
}
Return
}
Send,9
Return
.::
Thread, Interrupt, 250
KeyWait,.,T0.25
If(ErrorLevel)
{
If flag = l
{
Send, {Backspace}ḷ
flag = "l."
KeyWait,.
Return
}
If flag = r
{
Send, {Backspace}ṛ
flag = "r."
KeyWait,.
Return
}
If flag = n
{
Send, {Backspace}ṇ
KeyWait,.
Return
}
If flag = t
{
Send, {Backspace}ṭ
KeyWait,.
Return
}
If flag = d
{
Send, {Backspace}ḍ
KeyWait,.
Return
}
If flag = s
{
Send, {Backspace}ṣ
KeyWait,.
Return
}
If flag = h
{
Send, {Backspace}ḥ
KeyWait,.
Return
}
If flag = m
{
Send, {Backspace}ṃ
KeyWait,.
Return
}
KeyWait,.
Return
}
Send,.
Return
;Capslock::
; Send, !+2
; IME_SET(1)
; IME_SET(0)
; Send, +!3
; Return
;
;Ctrlを単押しでアルファベット入力に
$*LCtrl::
if (isCtrlRepeat == true) ;キーリピートしているかどうか
{
if (A_PriorKey != "LControl") ;Ctrl長押し中の他キー押し下げを検出
{
KeyWait, LCtrl
Send {Blind}{CtrlUp} ;Ctrlをリリース
isCtrlRepeat := false
Return
}
else Return
}
Send {Blind}{CtrlDown} ;Ctrlを押し下げ
isCtrlRepeat := true
Return
;Ctrlを離したときに判定
$*LCtrl up::
Send {Blind}{CtrlUp} ;Ctrlをリリース
isCtrlRepeat := false
if (A_PriorKey == "LControl"){ ;LCtrl単押しを検出
ShowMessage("Esperanta reĝimo")
Send, !+3
Return
}
Return
;Fを長押しで日本語入力に
f::
Thread, Interrupt, 250
KeyWait,f,T0.25
If(ErrorLevel)
{
Send, ^,
Send, !+2 ;日本語に復帰
ShowMessage("日本語入力")
KeyWait,f
Return
}
Send, f
Return
;Vを長押しで中国語入力に
v::
Thread, Interrupt, 250
KeyWait,v,T0.25
If(ErrorLevel)
{
ShowMessage("中文输入法")
Send, ^,
KeyWait,v
Return
}
Send, v
Return
]::
Thread, Interrupt, 250
KeyWait,],T0.25
FormatTime, CurrentDate,, yyyy-MM-dd
If(ErrorLevel)
{
SendInput %CurrentDate%
KeyWait,]
Return
}
Send, ]
Return
q::
Thread, Interrupt, 250
KeyWait,q,T0.25
send, q
flag = q
return
y::
Thread, Interrupt, 250
KeyWait,y,T0.25
send,y
return
p::
Thread, Interrupt, 250
KeyWait,p,T0.25
send,p
return
d::
Thread, Interrupt, 250
KeyWait,d,T0.25
FormatTime, CurrentDate,, yyyy-MM-dd
If(ErrorLevel)
{
SendInput %CurrentDate%
KeyWait,d
Return
}
flag = d
Send, d
Return
k::
Thread, Interrupt, 250
KeyWait,k,T0.25
send,k
return
z::
Thread, Interrupt, 250
KeyWait,z,T0.25
send,z
return
x::
Thread, Interrupt, 250
KeyWait,x,T0.25
send,x
return
b::
Thread, Interrupt, 250
KeyWait,b,T0.25
send,b
return
`;::
Thread, Interrupt, 250
KeyWait,`;,T0.25
send,`;
return
'::
Thread, Interrupt, 250
KeyWait,',T0.25
send, '
return
Enter::
Thread, Interrupt, 250
KeyWait,Enter,T0.25
send,{Enter}
return
/::
Thread, Interrupt, 250
KeyWait,/,T0.25
If(ErrorLevel)
{
Send, ^,
Send, !+2
Send, ^/
KeyWait,/
Return
}
send,/
return
8::
Thread, Interrupt, 250
KeyWait,8,T0.25
send, 8
return
0::
Thread, Interrupt, 250
KeyWait,0,T0.25
send, 0
return
-::
Thread, Interrupt, 250
KeyWait,-,T0.25
send,-
return
,::
Thread, Interrupt, 250
KeyWait,`,,T0.25
send,`,
return
ShowMessage(message) {
; Progress, B ZH0 FS20 WS700 CTEEEEEE CW333333, %message%, , , Segoe UI
Progress, B ZH0 FS20 WS700 CTAAFFEE CW112233 WM500, %message%, , progtip, 字体管家乌克丽丽
WinSet, Transparent, 150, progtip
SetTimer, HideMessage, 2000
}
HideMessage() {
Progress, off
SetTimer, HideMessage, off
}
IsWindowAlwaysOnTop(windowTitle) {
WinGet, windowStyle, ExStyle, %windowTitle%
return (windowStyle & 0x8) ; 0x8 is WS_EX_TOPMOST.
}
`::
Thread, Interrupt, 250
KeyWait,,T0.25
If(ErrorLevel)
{
Send,
KeyWait,
Return
}
Send, {Backspace}
ShowMessage("Backspacen(premu por `)")
Return
+::+
\::
Thread, Interrupt, 250
KeyWait,\,T0.25
If(ErrorLevel)
{
Send, \
KeyWait, \
Return
}
Send, {Backspace}
ShowMessage("Backspace`n(premu \ por \)")
Return
+\::+\
;Spaceを押したとき
$*Space::
if (isSpaceRepeat == true) ;キーリピートしているかどうか
{
if (A_PriorKey != "Space") ;Space長押し中の他キー押し下げを検出
{
KeyWait, Space
Send {Blind}{ShiftUp} ;Shiftをリリース
isSpaceRepeat := false
Return
}
else Return
}
Send {Blind}{ShiftDown} ;Shiftを押し下げ
isSpaceRepeat := true
Return
;Spaceを離したとき
$*Space up::
Send {Blind}{ShiftUp} ;Shiftをリリース
isSpaceRepeat := false
if (A_PriorKey == "Space"){ ;Space単押しを検出
Send {Blind}{Space} ;Spaceを入力
}
Return