I am trying to limit how frequently a script can execute. It is a very simple script, just rebinding the mouse wheel to a keyboard key. This is the only script I have running.
Here is what I have:
^+`::Suspend,Toggle
#HotkeyInterval 1
Wheeldown::SendInput {F12 down}{F12 up}
Suspend, On
Pause, On
Sleep, 3000
Suspend, Off
Pause, Off
return
The first line is so I can toggle it on and off and regain the normal functionality of the mouse wheel. In this example I am trying to get it to send a maximum of every 3 seconds regardless of how frequently I scroll down.
It is still sending F12 every time I scroll down and I want it to send F12 a maximum of let's say every 100ms. How can I do this?
Thank you
Limiting frequency of script execution
Re: Limiting frequency of script execution
When you have a multi line hotkey subroutine it has to be on its own line.
Code: Select all
^+`::Suspend,Toggle
#HotkeyInterval 1
Wheeldown::
SendInput {F12 down}{F12 up}
Suspend, On
Pause, On
Sleep, 3000
Suspend, Off
Pause, Off
return
Re: Limiting frequency of script execution
Got it to work, thanks!
^+`::Suspend,Toggle
#HotkeyInterval 1
Wheeldown::
SendInput {F12 down}{F12 up}
Suspend, On
Sleep, 100
Suspend, Off
return
Is there a way to make the script keep the hotkey "locked" while it is suspended? What I mean is, while it is on sleep aka not sending the F12 key, the mouse wheel returns to its normal functionality. I'd like for it to continue capturing the wheel down (preventing the wheel down command from being sent) but just not do anything for 100ms. If it's not possible or overly complex don't worry about it. Thanks.
^+`::Suspend,Toggle
#HotkeyInterval 1
Wheeldown::
SendInput {F12 down}{F12 up}
Suspend, On
Sleep, 100
Suspend, Off
return
Is there a way to make the script keep the hotkey "locked" while it is suspended? What I mean is, while it is on sleep aka not sending the F12 key, the mouse wheel returns to its normal functionality. I'd like for it to continue capturing the wheel down (preventing the wheel down command from being sent) but just not do anything for 100ms. If it's not possible or overly complex don't worry about it. Thanks.
Who is online
Users browsing this forum: jaka1 and 154 guests