Toggle activable with a Tap

7 views
Skip to first unread message

dore...@gmail.com

unread,
Mar 6, 2026, 6:30:09 AMMar 6
to QuadStick
Hello!
This is mostlya general question (or a request to Fred)
I was wondering is it is possible to have a Toggle function tobe activated as a Tap-like one (so only if you do a certain input within a specific milliseconds span of time)
The reason I'm asking s I've often needed a Toggle, but I also needed the same input to be able to be used for something else via a classic "delay_on" function on the script.
Until now I resorted into scripting a toggle via AHK, but it can be tedious to do everytime.

Thank you in advance!

Fred Davison

unread,
Mar 6, 2026, 11:00:26 AMMar 6
to dore...@gmail.com, QuadStick
There is a tap/toggle function:    "tap 300 1"

tap
 
When the input is activated for less than 500 ms and released, the output will be activated for 100 ms as the input is released.  If the input is activated for longer than 500 ms, the output remains off.  Can be used along with delay_on to allow a single sip/puff/lip input to control two outputs.  Two optional parameters allow control of the time period that determines the tap detection and the duration of the pulse when a tap is detected.  The default parameters are equivalent to "tap 500 100".  This function will clear any associated toggle or latch or delay_off when the input activates.
 
If the second parameter is exactly 1, the output will toggle on/off each time the input is activated for less than the delay period.

There is a corresponding delay_on/toggle function, that works the same way, too:

delay_on
 
Will prevent the output from turning on for a period of time (in ms) after an input goes active.  The default delay is 1000 ms.  An optional parameter can control the delay.  If an optional second parameter is present, the output will pulse for the duration of the second parameter and turn off.  By default the output will stay on as long as the input is active.  This function can be used to sequence up to six keyboard keys from one input.
 
If the second parameter is exactly 1, the output will toggle on/off each time the input is activated for longer than the delay period.


Reply all
Reply to author
Forward
0 new messages