Touch Support
Touch eventsinput handling is done by deriving from TouchableBehavior. Behaviors which are derived from genericCgiStudioControl::TouchableBehavior eventsget registered to the TouchSession and arewill equallyreceive easyInput toEvents implement.Foras anClick, examplePressed ofetc use have a look atthrough the ToggleButtonWidgetOnEvent function.
For it'sexample:
Derive from TouchableBehavior:
class CgiEventWidget.ControlStateBehavior : public TouchableBehavior
Override OnEvent function:
const UInt cTbTouchEventExit = CgiEventWidget::TouchEventExit; const UInt cTbTouchEventUp = CgiEventWidget::TouchEventUp; const UInt cTbTouchEventDown = CgiEventWidget::TouchEventDown; Base::SetEventMask(cTbTouchEventExit | cTbTouchEventUp | cTbTouchEventDown);
protected: virtual voidOnTouchEvent(TouchEventOnEvent(consttouchEvent,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 be used to react on the user's input.
For more information, please check Candera::NodeTouch Input Handling.*
To const CgiApplication::MouseEvent& event);
outswitch(touchEvent)Gesture{Detectorcase TouchEventDown: m_focus = true; SetOn(!IsOn()); break; case TouchEventUp: if (m_focus) { SendUiEvent(TouchEventClick, 0); } break; case TouchEventExit: m_focus = false; m_down = !m_down; SwitchTexture(); break; default: break; }
page.