Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Touch observer essentials

Before an application can query the Touch Observer, it must query the root container to obtain the touch observer object by calling IWidget_GetTouchObserver(). For example:

nErr = IWidget_GetTouchObserver(piwRoot, &pito);

After obtaining the touch observer object, the application can start observation, retrieve information about the touch observer or about gestures, and stop observation.

Starting observation

There are five types of gestures that can be observed, as follows:

  • Last linear movement determination (TOUCHOBSF_LLM)
  • Tap (TOUCHOBSF_TAP)
  • Double tap (TOUCHOBSF_DBLTAP)
  • Tap and Hold (TOUCHOBSF_TAPANDHOLD)
  • Multiple linear movements (TOUCHOBSF_MULT_LM)

To retrieve information about a gesture, an application calls IObserver_StartObservation() for that particular gesture. For example, to start observing the last linear determination and double tap, make the following calls:

nErr = IObserver_StartObservation(pif, TOUCHOBSF_LLM);
if (AEE_SUCCESS == nErr) {
   nErr = IObserver_StartObservation(pif, TOUCHOBSF_DBLTAP);
}

To check which gestures the Touch Observer is monitoring, call IObserver_GetObservation(), as follows:

nErr = IObserver_GetObservation(pif, &observe);

For more information, see Handling tap, double tap, and hold.

Retrieving information

To retrieve specific information about a gesture, an application can call one of the IObserver APIs associated with the gesture. For more information on IObserver APIs, see Touch observer interface.

Stopping observation

When an application is finished with observation, it should stop the observation, as follows:

nErr = IObserver_StopObservation(pif, TOUCHOBSF_LLM);
 if (AEE_SUCCESS == nErr) {
   IObserver_StopObservation(pif, TOUCHOBSF_DBLTAP);
}