|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-4102F39E-6215-44AD-9E30-6D8E86114D7D" xml:lang="en"><title>Creating |
|
13 the long-tap detector</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 <p>To use the long-tap detector in your application, create an instance of |
|
15 the class <codeph>CAknLongTapDetector</codeph>.</p> |
|
16 <p>You must give the long-tap detector constructor a pointer to the owner; |
|
17 otherwise the detector doesn’t know where to report long tap events. </p> |
|
18 <p>You cannot set other long-tap detector parameters in the constructor. To |
|
19 change these parameters, use the other methods in the API after the detector |
|
20 is succesfully constructed. </p> |
|
21 <p>You also need to pass any pointer events from the client side component |
|
22 to the long-tap detector and enable pointer grab for the control’s window.</p> |
|
23 <codeblock xml:space="preserve">void CMyContainer::ConstructL( const TRect& aRect ) |
|
24 { |
|
25 … |
|
26 iLongTapDetector = CAknLongTapDetector::NewL( this ); |
|
27 DrawableWindow()->SetPointerGrab( ETrue ); |
|
28 … |
|
29 } |
|
30 |
|
31 void CMyContainer::HandlePointerEventL( const TPointerEvent& aEvent ) |
|
32 { |
|
33 … |
|
34 iLongTapDetector->PointerEventL( aEvent ); |
|
35 … |
|
36 } |
|
37 </codeblock> |
|
38 </conbody></concept> |