Multiple Button Event Hold Times
jabramson
Posts: 106
I'd like to set up button events with different hold times, I.E. Buttons 1-5 do a function after a hold of "5" and buttons 6-10 run after a hold of "10".
Tried putting in 2 different Hold definitions but it only lets me do one. What's the best way of doing this?
Tried putting in 2 different Hold definitions but it only lets me do one. What's the best way of doing this?
0
Comments
Very nice! I learned something new today.
I learned something new too!
Does this work in practice? I've noticed that the button.holdtime increase every time so its only 50 the first time through, and can also be slightly off from the repeat time like 51, 101, 151 instead of 50, 100, 150. When I've done this I've had to use >< to compare due to this anomaly, but normally I create two button events. I've also triggered a phantom button event from another button event to flash an LED at a fast rate while the actual hold that does something is at a slower rate. For instance if you want to send a volume up command every 5 tenths, but flash the volume LED every 1 tenth.
Paul
I was able to reproduce this a while ago, unless its been fixed. I was using division on the holdtime, and it was never working out correctly. When I printed the hold time to the console I was getting values like 399, 401, 500 etc. I guess depending on what else is going on in the system you are not guaranteed that your hold will be precisely the right amount. Holdtime is in hundreds of a second and the hold is in tenths so that might account for it.
Paul