Author Topic: Checking if button was held in click handler  (Read 2070 times)

0 Members and 1 Guest are viewing this topic.

chrisbtreats

Checking if button was held in click handler
« on: March 13, 2012, 09:29:58 AM »
I am trying to make a simple menu system using the MenuBackend library and the Button library being driven by 3 buttons. 2 buttons will drive the up and down behavior of the menu and the 3rd button will be left and right. I want right to happen when the button is clicked and left to happen when the button is held for one second. The problem I am having is that the click handler is being called after the hold Handler and there is now way to check in the click handler to check if the held handler was called. I tried calling "held(1000)" and heldFor(1000) in my click handler but it always returns false. I think this is because "triggeredHoldEvent" is true in "held()" and "isPressed()" is false in "heldFor()". The only think I could think of is check "btn.holdTime()<1000" in my click handler.

Any help would be appreciated.

barakasMuh

Checking if button was held in click handler
« Reply #1 on: May 07, 2016, 10:59:43 AM »
well its just a list of commands, no logic or anything so theres not really anything anyone could suggest