Symbian3/SDK/Source/GUID-E402616A-7ED8-45AC-B836-99C3A3760B33.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 11 Jun 2010 12:39:03 +0100
changeset 8 ae94777fff8f
parent 7 51a74ef9ed63
child 13 48780e181b38
permissions -rw-r--r--
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-E402616A-7ED8-45AC-B836-99C3A3760B33" xml:lang="en"><title>Key events</title><prolog><metadata><keywords/></metadata></prolog><conbody>
<fig id="GUID-9A1FDF4B-5FD8-4113-8D8E-E879B4C7C255"><title>Key presses generate key events</title><image href="GUID-C9429505-EEE7-4E64-BE0A-BC5D57D5B42C_d0e37243_href.png"/></fig>
<p>Key events are generated when a device user presses one or more device
key buttons. The application framework delivers the event to the application
that has focus. The <parmname>TKeyEvent</parmname> structure is used to contain
the key event details delivered to the application. For more information on <parmname>TKeyEvent</parmname>,
see <xref href="GUID-0F8FA6A3-F172-36E4-9CF5-60814ABCD562.dita"><apiname>TKeyEvent</apiname></xref>. </p>
<p>The structure is as follows:</p>
<codeblock id="GUID-467AB9BB-948F-49B6-A243-206314E90242" xml:space="preserve">struct TKeyEvent
    {
    TUint iCode;
    TInt iScanCode;
    TUint iModifiers; // State of modifier keys
    TInt iRepeats; // Count of auto repeats generated
    };
</codeblock>
<p>The following events are generated by means of a single key press and
release:</p>
<codeblock id="GUID-5FE1F179-8F7A-4653-9604-3CFC4B66AE33" xml:space="preserve">EEventKeyDown
EEventKey
EEventKeyUp

</codeblock>
<p>The first event indicates that a key has been pressed down. The second
event indicates that a character has been received from the keyboard. The
third event is sent when the button has been released. These events are described
in the <parmname>iCode</parmname> and <parmname>iSCanCode</parmname> members
of <parmname>TKeyEvent</parmname>.</p>
<p>For more information on possible data contained in <parmname>EEventKey</parmname>,
see <xref href="GUID-B67B6ED5-6C8F-3B36-934C-B47A109A515F.dita"><apiname>TKeyCode</apiname></xref>.</p>
<p>Key presses may be interpreted by a Front End Processor (FEP) and tied
to specific key events. For example, if a device user presses the <parmname>2</parmname> key
twice, an active FEP could generate a key event code of <parmname>b</parmname>.</p>
<p> For more information on FEPs, see <xref href="GUID-FCEDC338-61CA-5D10-A8DB-E44A3EBBDE5E.dita">Front
End Processor overview</xref>.</p>
</conbody></concept>