热键不循环发送命令

Hotkey doesn't loop with Send command

我有这段代码,我想只要我按住 ctrl+n,它就会点击并拖动。它不会循环使用发送命令。它只运行一次,除非我放开 ctrl 和 n 并再次按下。如果我将它们注释掉,当我按住它时热键循环非常好。这是我的脚本:

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Enable warnings to assist with detecting common errors.
; SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.


^n::
CoordMode, Mouse, Screen
Send {LButton down} ;if i comment these two out it works fine
MouseMove, 0, 30, 20, R
Send {LButton up} ; ditto
return

问题出在 ctrl 键上。按下时,它会停止热键的新执行。我在没有 ctrl 前缀的情况下尝试了它,只使用了 n:: 并且它工作正常。如果您按 ctrl+n 然后释放它然后再按一次,它也可以工作。 无论如何,当您在前面添加热键修饰符 $ 符号时,它会如您所愿地工作。

热键修饰符$解释:

这通常仅在脚本使用发送命令发送包含热键本身的键时才有必要,否则可能会导致它自行触发。 $ 前缀强制使用键盘钩子来实现此热键,作为副作用会阻止发送命令触发它。 $ 前缀相当于在该热键定义之上的某处指定了#UseHook。

更多信息: https://www.autohotkey.com/docs/Hotkeys.htm

$^n::
CoordMode, Mouse, Screen
Send {LButton down}
MouseMove, 0, 30, 20, R
Send {LButton up}
return