PDA

View Full Version : Action on button press >= 2 seconds...how?



BamBam0099
July 16th, 2008, 07:15 AM
I've tried everything and read all the docs and still it doesn't work.

The scenario is easy, I want to have an action occur when I press and hold a button for 2+ seconds. The problem is that as soon as I press the button (with interval property set), the defined action occurs immediately no matter what the action is, then the interval part works correctly but I just can't seem to have it ignore executing the action as soon as the button is pressed. I want the action to occur only once and that's when the elapsed time from the initial button press and hold is >= 2 seconds.

Any ideas? I've tried using the up property but for some reason, events will not trigger on button up.

Thanks in advance to all replies....

quixote
July 16th, 2008, 04:07 PM
If you can see events occuring in the logger for both the down and up events, then you can set up a simple timer to fire an action after 2000ms, set the timer to be triggered by the down event and then set the up event to cancel that timer (by creating a second timer with the same number but 0ms and pointing to no actions).

BamBam0099
July 17th, 2008, 04:59 AM
If you can see events occuring in the logger for both the down and up events, then you can set up a simple timer to fire an action after 2000ms, set the timer to be triggered by the down event and then set the up event to cancel that timer (by creating a second timer with the same number but 0ms and pointing to no actions).

Thanks for the reply but as I stated in the original post, events do not occur for up button. What a pain this has become for such a seemingly simple task...

quixote
July 17th, 2008, 06:01 AM
Then you need to buy a new remote. Girder cannot magically enhance your hardware. :)

BamBam0099
July 17th, 2008, 11:11 AM
Then you need to buy a new remote. Girder cannot magically enhance your hardware. :)

Interesting...I tried 3 different 'entertainment center' remotes and all sent signals flawlessly and yet none of them triggered an up button event...

Thanks for the reply

quixote
July 17th, 2008, 11:55 AM
Can you tell us which remotes you tried? Maybe someone here can confirm that it is a hardware issue. Some remotes will throw out a different code when you release the button with no mention of the word "up" in Girder. In that case, you would need to treat it as a different event. I've even seen remotes that spit out different codes each time you press a button, even if you're pushing the same button over and over again.