首页 > 解决方案 > 优化自动热键代码/发送键盘代码

问题描述

我对 AutoHotkey 的功能印象深刻。如何优化该代码?我需要知道什么?

SetTitleMatchMode RegEx ;

::/act1::
Send {LControl down}
Send {LShift down}
Send {m}
Send {LControl up}
Send {LShift up}
Send {Left 3}
Send {LShift down}
Send {Home}
Send {LShift up}
Send {LControl down}
Send {c}
Send {LControl up}
WinActivate WidnowA
Send {LControl down}
Send {Home}
Send {LControl up}
Send {Down 1}
Send {Right 12}
Send {LControl down}+{v}
Send {LControl up}
Send {,}
Send {Space}
Send {LControl down}
Send {s}
Send {LControl up}
CoordMode, Mouse, Screen
x := 150
y := 1420
Click %x% %Y%
Send {Right 3}
return

我认为不需要描述这些部分,但是..我可以用另一种(最简单的)方式来写吗?

谢谢

标签: autohotkey

解决方案


我认为这里没有太多优化空间,因为没有太多重复。如果您使用了相同系列的击键,则可以使用函数减少重复。但是,您似乎在“WinActivate WidnowA”处有错字

一种可能的改进是将您对“Send”的使用更改为“ SendInput ”,这“通常更快、更可靠”。


推荐阅读