在AHK脚本的行开头,星号是什么意思?

lan*_*nce 8 syntax autohotkey

我正在尝试修改我喜欢的AHK脚本,但并不完全理解.

这行脚本开头的星号是什么意思?

*capslock::

最后一对冒号是否意味着这条线只是声明的一部分?它会继续下一行吗?

Jef*_*ker 6

无论按下哪个修改器,都会触发热键.

http://www.autohotkey.com/docs/Hotkeys.htm

通配符:即使按下额外的修改器,也要触发热键.这通常与重新映射键或按钮结合使用.例如:

Win + C,Shift + Win + C,Ctrl + Win + C等都将触发此热键.

*#c::Run Calc.exe  

即使modifer键已关闭,按Scrolllock也会触发此热键.

*ScrollLock::Run Notepad 

编辑:嗯,没看到第二部分.

如果你有一个声明,你可以把它全部放在一行上面.如果您有多个语句,则必须在该语句之后添加一个换行符::并且return最后一个语句.

#w:: MsgBox "Windows+W FTW"
#q::
  MsgBox "Windows+Q FTW"
  MsgBox "Another annoying message box!"
  return
Run Code Online (Sandbox Code Playgroud)

我有一种方法可以使用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     
Run Code Online (Sandbox Code Playgroud)