AutoHotKey:按下另一个按钮时以及释放后发送一个按钮

发布于 2024-11-19 08:04:03 字数 262 浏览 4 评论 0原文

在自动热键中 我想编写一个脚本,在按住鼠标右键时按一次按钮 并在释放后按另一个。

我尝试写一些东西(我使用 numpad0 而不是鼠标按钮)

Numpad0::
Send {d}

Numpad0 Up::
Send {u}

,但是它一直发送 du ,而不仅仅是 d 和最后的 u >。

这是为什么?

in AutoHotKey
I want to write a script that will press a button once when the right mouse button is held
and press another once its released.

I tried writing something (I used numpad0 instead of mousebutton)

Numpad0::
Send {d}

Numpad0 Up::
Send {u}

but, it keeps sending du all the time, instead of just d and a final u.

why is that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最丧也最甜 2024-11-26 08:04:03

如果您将热键命令放在声明热键的不同行上,则需要使用 return 语句来结束它:

Numpad0::
Send {d}
return

Numpad0 Up::
Send {u}
return

您也可以在一行上声明每个热键,而不需要 >return 如果你不想做太多:

Numpad0:: Send {d}
Numpad0 Up:: Send {u}

If you're putting your hotkey command on a different line to where the hotkey is declared you need to use a return statement to end it:

Numpad0::
Send {d}
return

Numpad0 Up::
Send {u}
return

You can also just declare each hotkey on one line without a return if you're not trying to do too much:

Numpad0:: Send {d}
Numpad0 Up:: Send {u}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文