|
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-E402616A-7ED8-45AC-B836-99C3A3760B33" xml:lang="en"><title>Key events</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
13 <fig id="GUID-9A1FDF4B-5FD8-4113-8D8E-E879B4C7C255"><title>Key presses generate key events</title><image href="GUID-C9429505-EEE7-4E64-BE0A-BC5D57D5B42C_d0e64219_href.png"/></fig> |
|
14 <p>Key events are generated when a mobile device user presses one or more |
|
15 mobile device key buttons. The application framework delivers the event to |
|
16 the application that has focus. The <parmname>TKeyEvent</parmname> structure |
|
17 is used to contain the key event details delivered to the application. For |
|
18 more information on <parmname>TKeyEvent</parmname>, see <xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/Window_Server/TKeyEventStruct.html" format="application/java-archive"><parmname>TKeyEvent</parmname></xref>. </p> |
|
19 <p>The structure is as follows:</p> |
|
20 <codeblock id="GUID-467AB9BB-948F-49B6-A243-206314E90242" xml:space="preserve">struct TKeyEvent |
|
21 { |
|
22 TUint iCode; |
|
23 TInt iScanCode; |
|
24 TUint iModifiers; // State of modifier keys |
|
25 TInt iRepeats; // Count of auto repeats generated |
|
26 }; |
|
27 </codeblock> |
|
28 <p>The following events are generated by means of a single key press and |
|
29 release:</p> |
|
30 <codeblock id="GUID-5FE1F179-8F7A-4653-9604-3CFC4B66AE33" xml:space="preserve">EEventKeyDown |
|
31 EEventKey |
|
32 EEventKeyUp |
|
33 |
|
34 </codeblock> |
|
35 <p>The first event indicates that a key has been pressed down. The second |
|
36 event indicates that a character has been received from the keyboard. The |
|
37 third event is sent when the button has been released. These events are described |
|
38 in the <parmname>iCode</parmname> and <parmname>iSCanCode</parmname> members |
|
39 of <parmname>TKeyEvent</parmname>.</p> |
|
40 <p>For more information on possible data contained in <parmname>EEventKey</parmname>, |
|
41 see <xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/Kernel_Architecture_2/e32keys.hGlobals.html#%3a%3aTKeyCode" format="application/java-archive"><parmname>TKeyCode</parmname></xref>.</p> |
|
42 <p>Key presses may be interpreted by a Front End Processor (FEP) and tied |
|
43 to specific key events. For example, if a mobile device user presses the <parmname>2</parmname> key |
|
44 twice, an active FEP could generate a key event code of <parmname>b</parmname>.</p> |
|
45 <p> For more information on FEPs, see <xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/guide/Application-Framework-subsystem-guide/fepbase/FrontEndProcessorOverview.guide.html#ApplicationFrameworkOverview%2eFrontEndProcessorOverview%2emain" format="application/java-archive">Front End Processor overview</xref>.</p> |
|
46 </conbody></concept> |