Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Hi,

I am in the process of converting a widget based BREW MP application developed to handle key events to a touch screen application.

 

I am following the documents provided on BREW MP site.

the document widgets_touchscreen_tech_guide.pdf mention about "Replacing Default Touch Controller"

In m current application I have replaced default key handler for the widget and provided a custom key handler using API HANDLERDESC_INIT and IWidget_SetHandler.

Can I use this same event handler function to catch touch events(EVT_POINTER_XXXX) ??

What is the difference between Default EventHandler and Default TouchController? Can I use the custom eventhandler function for the widget to handle its touch event??

 

My second doubt is:

Is it always necessary to retrieve IObserver from RootContainer and attach a Listner to it.

Because without doing the above step, and just by creating a root container in the app and enabling its touch ,

I am receiving EVT_POINTER_UP and EVT_POINTER_DOWN events in my widgets custom event handler.

 

What is the use of IObserver if I am able to receive touch events with retrieving it from the rootcontainer.

Eagerly Waiting for the response

-Pradnya

No need to provide custom controller. The default controller can handle touch events. you need to enable touch on root container using IWidget_EnableTouch and pass all the raw events to root container. Root container will automatically delegates the events to children. To capture gestures/events on particular widget, lets say list widget you need to provide model listener. HANDLERDESC_INIT and IWidget_SetHandler is used to set that listener.
Observer/Listener mechanism is used to capture gestures/events and handle them through callback functions.
Custom controllers are used to override the default one and provide your own implementation. I think in your case its not required.
 

No need to provide custom controller. The default controller can handle touch events. you need to enable touch on root container using IWidget_EnableTouch and pass all the raw events to root container. Root container will automatically delegates the events to children. To capture gestures/events on particular widget, lets say list widget you need to provide model listener. HANDLERDESC_INIT and IWidget_SetHandler is used to set that listener.
Observer/Listener mechanism is used to capture gestures/events and handle them through callback functions.
Custom controllers are used to override the default one and provide your own implementation. I think in your case its not required.