在AHK脚本的开头部分,星号是什么意思?
我试图修改一个我喜欢但不完全理解的AHK脚本。
这行脚本开头的星号是什么意思?
*capslock::
最后一对冒号是否意味着这条线只是声明的一部分? 它继续到下一行吗?
不管修饰符被按下,都会触发热键。
http://www.autohotkey.com/docs/Hotkeys.htm
通配符:即使多余的修饰符被按下,也会启动热键。 这通常与重新映射键或按钮一起使用。 例如:
Win + C,Shift + Win + C,Ctrl + Win + C等都会触发这个热键。
*#c::Run Calc.exe
即使修改键(S)关闭,按Scrolllock也会触发该热键。
*ScrollLock::Run Notepad
编辑:嗯,没有看到第二部分。
如果你有一个单一的陈述,你把它全部放在上面的一行上。 如果你有多个语句,你必须在::之后加一个换行符,并在最后return 。
#w:: MsgBox "Windows+W FTW"
#q::
MsgBox "Windows+Q FTW"
MsgBox "Another annoying message box!"
return
我有一种使用capslock键作为我更喜欢的修饰符的方法:
;; make capslock a modifier, make shift-capslock a true capslock
setcapslockstate, OFF ;SetCapsLockState, alwaysoff
$*Capslock:: ; $ means that the hotkey code shouldn't trigger its own hotkey
Gui, 99:+ToolWindow
Gui, 99:Show, x-1 w1 +NoActivate, Capslock Is Down
keywait, Capslock
Gui, 99:Destroy
return
; Made a window show up when the capslock is pressed.
; Now, if that hidden windown is there, do anything you like
#IfWinExist, Capslock Is Down
j::Left
k::Right
i::Up
m::Down
#IfWinExist
; Oh, by the way, right-alt and capslock works like real capslock
ralt & Capslock::
GetKeyState, capstate, Capslock, T
if capstate = U
{
SetCapsLockState, on
} else {
SetCapsLockState, off
}
return
链接地址: http://www.djcxy.com/p/59133.html
上一篇: What does an asterisk mean at the beginning of an AHK script's line?
