autohotkey 脚本结合而不是替换鼠标滚轮的原始功能

autohotkey script combining rather than replacing mouse wheels original function

我有一个用于 adobe illustrator 的 AHK 脚本,它应该用 alt 和鼠标滚轮替换常规鼠标滚轮,但是当我滚动鼠标滚轮时,它同时执行 Alt 鼠标滚轮和常规鼠标滚轮功能。如何取消原有的鼠标滚轮功能,使其在滚动鼠标滚轮时只执行alt & mouse wheel?

#SingleInstance ignore 
#IfWinActive ahk_exe Illustrator.exe

{
;Switches Alt+Wheelup with Wheelup 
wheelup::
Send !{Wheelup} 
Return

;Switches Alt+Wheeldown with Wheeldown 
Wheeldown:: 
Send !{Wheeldown} 
Return
}

原来的滚轮功能是上下滚动,alt 滚轮缩放,所以使用这个脚本,输出最终是滚动和缩放的组合,当我只想缩放时。

我认为正在发生的事情是,偶尔会有一些 wheelup/downs 在发生看不见的 {alt up} 时正确开火。我也遇到过这种情况(改为使用 ctrl)。然后我尝试使用热键命令;它似乎表现得更好,但有时仍会滚动。对我有用的是在 {alt up} 之前延迟,这样如果热键在完成之前再次触发,它仍将处于 {alt down} 状态。

看看这是否适合你:

wheelup::
Send , {alt down}{wheelup}
Sleep , 100
Send , {alt up}
Return

wheeldown:: 
Send , {alt down}{wheeldown}
Sleep , 100
Send , {alt up}
Return