|
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_d0e42810_href.png"/></fig> |
|
14 <p>Key events are generated when a device user presses one or more device |
|
15 key buttons. The application framework delivers the event to the application |
|
16 that has focus. The <parmname>TKeyEvent</parmname> structure is used to contain |
|
17 the key event details delivered to the application. For more information on <parmname>TKeyEvent</parmname>, |
|
18 see <xref href="GUID-0F8FA6A3-F172-36E4-9CF5-60814ABCD562.dita"><apiname>TKeyEvent</apiname></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="GUID-B67B6ED5-6C8F-3B36-934C-B47A109A515F.dita"><apiname>TKeyCode</apiname></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 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="GUID-FCEDC338-61CA-5D10-A8DB-E44A3EBBDE5E-GENID-1-8-1-3-1-1-9-1-3-1.dita">Front |
|
46 End Processor overview</xref>.</p> |
|
47 </conbody></concept> |