Analog of "OnMouseButtonDown" and "OnMouseButtonUp" for touch

The “Touch 1” event fires everywhere, no matter is it placed in the widget or in the controller. The “OnTouchStarted” and “OnTouchEnded” work only when the user still touches screen but leads the finger outside of the widget. The “GetInputTouchState” does not work when touching a button. Which can be the proper solution?

Bump. The topic is actual.

Double bump.

Triple bump.

Quadruple bump.

Hey there @Etyuhibosecyu! What’s the full use case? The widget events OnPressed and OnReleased are technically analogous with a couple small differences, though it is only for widgets.

Hello @SupportiveEntity! I want to make a menu that is collapsed by default, expanded by the touch to the “spoiler” and collapsed again by the touch at some other place. At present time I have made this only by wrapping the entire menu into a button. I doubt if this is a good solutioln.

Technically having the menu’s head be a button (not the whole menu) and using OnPressed and OnRelease should be fine. It’s slightly different from it’s basic use case, but I don’t feel it strays far enough to be a bad implementation unless you need extra functionality than just opening it like a spoiler.