Skip to main content

Touch Support

Touch input handling is done by deriving from TouchableBehavior. Behaviors which are derived from CgiStudioControl::TouchableBehavior get registered to the TouchSession and will receive Input Events as Click, Pressed etc through the OnEvent function.

For example:

Derive from TouchableBehavior:

class ControlStateBehavior : public TouchableBehavior

Override OnEvent function:

protected:

  virtual void OnEvent(const FeatStd::Event& event, Candera::EventDispatchResult& dispatchResult) override;


One such behavior is the "Handle Control State" behavior. In SceneComposer, just add a "Handle Control State" to a node and it will be able to receive touch events. Pair it with a condition behavior such as "Check Click" or "Check Hover", and you will be able to detect touch events and can react based on the user's input.

For more information, please check Touch Input Handling.

To implement your own custom gesture handler (that is not a click or hover, etc), please check out Gesture Detector page.