Namespaces
Variants
Actions
(Difference between revisions)

Pointer capturing in Symbian C++ on touch-enabled devices

Jump to: navigation, search
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
__NOEDITSECTION__
 
__NOEDITSECTION__
 
+
{{KBCS}}
{|style="background:#eceff2" width="660px" border="1" cellpadding="5" cellspacing="0"
+
{{CodeSnippet
|-
+
|id=CS001145
|'''ID''' ||  
+
|platform=S60 5th Edition
|'''Creation date''' || September 29, 2008
+
|devices=Nokia 5800 XpressMusic
|-
+
|category=Symbian C++
|'''Platform''' || S60 5th Edition
+
|subcategory=Touch UI
|'''Tested on devices''' || Nokia 5800 XpressMusic
+
|creationdate=October 14, 2008
|-
+
|keywords=CCoeControl::SetPointerCapture()
|'''Category''' || Symbian C++
+
}}
|'''Subcategory''' || Touch UI
+
|}
+
 
+
 
+
{|style="background:#eceff2" width="660px" border="1" cellpadding="5" cellspacing="0"
+
|-
+
|'''Keywords (APIs, classes, methods, functions):''' CCoeControl::SetPointerCapture()
+
|}
+
  
 
==Overview==
 
==Overview==
  
S60 5th Edition supports touch events. Pointer events are sended to the active ui application  
+
S60 5th Edition supports touch events. Pointer events are sent to the active UI application container control if the pointer/stylus is on the application.
container control if pointer/stylus is on the application.
+
  
Container control base class implementation CCoeControl::HandlePointerEvent() redirects
+
The container control base class implementation <tt>CCoeControl::HandlePointerEvent()</tt> redirects events to its child controls. Remember to implement event handling into every custom UI control in your application.
events to its child controls. You have to remember implement event handling into every custom ui controls in your application.
+
  
If you want that one ui control receives all pointer events, it can be done by CCoeControl::SetPointerCapture()
+
If you want one UI control to receive all pointer events, use  <tt>CCoeControl::SetPointerCapture()</tt>.
  
 
==MMP file==
 
==MMP file==
Line 59: Line 49:
 
==Postconditions==
 
==Postconditions==
  
On ui contol receives all touch events.
+
One UI control receives all touch events.
  
 
==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/6e12c32a-5c7f-4829-8dfb-ba7aaaca63fa/S60_5th_Edition_Solitaire_Game_Example.html S60 5th Edition: 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 Platform: Image Converter 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]]
+
[[CS001144 - Handling pointer events]]
  
 +
[[CS001146 - Enabling drag events in touch-enabled devices]]
  
 
[[Category:Symbian C++]][[Category:Code Examples]][[Category:Touch UI]]
 
[[Category:Symbian C++]][[Category:Code Examples]][[Category:Touch UI]]

Revision as of 12:54, 14 October 2008


Template:KBCS

Article Metadata

Tested with
Devices(s): Nokia 5800 XpressMusic

Compatibility
Platform(s): S60 5th Edition

Article
Keywords: CCoeControl::SetPointerCapture()
Created: (14 Oct 2008)
Last edited: Forum Nokia KB (14 Oct 2008)

Overview

S60 5th Edition supports touch events. Pointer events are sent to the active UI application container control if the pointer/stylus is on the application.

The container control base class implementation CCoeControl::HandlePointerEvent() redirects events to its child controls. Remember to implement event handling into every custom UI control in your application.

If you want one UI control to receive all pointer events, use 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

One UI control receives all touch events.

See also

S60 5th Edition: Solitaire Game Example

S60 Platform: Image Converter Example

CS001144 - Handling pointer events

CS001146 - Enabling drag events in touch-enabled devices

148 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved