gpt4 book ai didi

syntax - AHK 脚本行开头的星号是什么意思?

转载 作者:行者123 更新时间:2023-12-04 08:13:18 35 4
gpt4 key购买 nike

我正在尝试修改我喜欢但不太完全理解的 AHK 脚本。

这行脚本开头的星号是什么意思?
*capslock::
末尾的一对冒号是否意味着该行只是语句的一部分?是否继续到下一行?

最佳答案

无论按下的修饰符如何,都会触发热键。

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

Wildcard: Fire the hotkey even if extra modifiers are being held down. This is often used in conjunction with remapping keys or buttons. For example:

Win+C, Shift+Win+C, Ctrl+Win+C, etc. will all trigger this hotkey.

*#c::Run Calc.exe  

Pressing Scrolllock will trigger this hotkey even when modifer key(s) are down.

*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

关于syntax - AHK 脚本行开头的星号是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10334603/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com