Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.
Advanced pointer events for multi touch
Advanced pointer events were introduced for Symbian^3, and thus they are not working on previous platform versions. To enable receiving the advanced pointer events for a window, a new function called EnableAdvancedPointers() needs to be called before the window is activated. For CCoeControl derived classed this can be handled with following line of code:
Then if you wish also to get any drag events, then you should also remember to call EnableDragEvents() for the CCoeControl derived class.
The actual advanced pointer events are then delivered to the application via normal HandlePointerEventL() function, and in it you could get the actual advanced pointer event by calling the AdvancedPointerEvent() for the normal pointer event like this:
const TAdvancedPointerEvent* AddPoinv = aPointerEvent.AdvancedPointerEvent();
The TAdvancedPointerEvent has several functions that return more information on the pointer event such as:
- Proximity() that returns the proximity.
- Pressure() that returns the pressure.
- ProximityAndPressure() that returns the proximity and pressure combined
- Position3D() that returns the proximity and the X, Y and Z coordinates.
- Pressure3D() that returns the pressure and the X and Y coordinates.
And to distinguish between different pointers you could use the PointerNumber() function. It is returning an index of the pointer event can have value between zero and Max number of pointers defined for the device.
Full example on how advanced pointer events can be used for detecting multi touch events can be downloaded from: Advanced Pointer.zip