Pointer capturing in Symbian C++ on touch-enabled devices
| Line 63: | Line 63: | ||
==See also== | ==See also== | ||
| + | [[http://www.forum.nokia.com/info/sw.nokia.com/id/6e12c32a-5c7f-4829-8dfb-ba7aaaca63fa/S60_5th_Edition_Solitaire_Game_Example.html S60 5th Solitaire Game Example]] | ||
| + | |||
| + | [[http://www.forum.nokia.com/info/sw.nokia.com/id/567330dd-130f-4f1d-9380-fac5aec5a6a9/S60_Platform_Image_Converter_Example.html S60 5th ImageConverter Example]] | ||
| + | |||
[[Category:Symbian C++]][[Category:Code Examples]][[Category:Touch UI]] | [[Category:Symbian C++]][[Category:Code Examples]][[Category:Touch UI]] | ||
Revision as of 21:48, 9 October 2008
| ID | Creation date | September 29, 2008 | |
| Platform | S60 5th Edition | Tested on devices | Nokia 5800 XpressMusic |
| Category | Symbian C++ | Subcategory | Touch UI |
| Keywords (APIs, classes, methods, functions): CCoeControl::SetPointerCapture() |
Overview
S60 5th Edition supports touch events. Pointer events are sended to the active ui application container control if pointer/stylus is on the application.
Container control base class implementation CCoeControl::HandlePointerEvent() redirects events to its child controls. Child control receives events if its borders (TRect) are inside pointer event. You have to remember implement event handling CCoeControl::HandlePointerEvent() into every ui controls in your application.
If you want that one ui control receives all pointer events, it can be done by CCoeControl::SetPointerCapture()
MMP file
The following libraries are required:
LIBRARY cone.lib
Source file
void CMyContainer::EatAllEvents()
{
// This start eating all pointer events from other ui control in this application.
SetPointerCapture(ETrue);
}
void CMyContainer::ReleaseEventCatching()
{
// Disables pointer capturing
SetPointerCapture(EFalse);
}
Postconditions
On ui contol receives all touch events.

