93 views
in GUI Development by
Hi!

I've implemented toggle button which should react for long press and short press events.  I've set 'Multitouch event' of touch handler to true. I've ticked retarget condition including long press. I've assigned a value to retarget delay. I've set my long press slot to 'On Hold' Property. I've set my short press slot to 'On Press Touch'. My problem is when I long press, my short press also getting executed. How do I realize this long press effect of this toggle button?

Thank you

Thanushiyah

1 Answer

0 votes
by

Hello,

I've set 'Multitouch event' of touch handler to true. I've ticked retarget condition including long press. I've assigned a value to retarget delay.

that is not necessary unless you have two touch handlers stacked one above another. Usually following steps are sufficient:

1. Implement a slot method and connect it to Simple Touch Handler OnRelease property.

2. In the slot method evaluate the hold period of the handler. For example:

With this implementation the decision between short/long press is made when the user released the finger. You can additionally:

3. Add a second slot method and connect it to the property OnHold of the Simple Touch Handler.

4. In the slot method you can react when the user holds the handler for a longer time without releasing it:

I hope it helps you further. See also the documentation of the Simple Touch Handler.

Best regards

Paul Banach

Embedded Wizard Website | Privacy Policy | Imprint

...