Adaptation/GUID-F9558573-7C79-57C5-809A-9257BF84758A.dita
changeset 15 307f4279f433
equal deleted inserted replaced
14:578be2adaf3e 15:307f4279f433
       
     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-F9558573-7C79-57C5-809A-9257BF84758A" xml:lang="en"><title>Architecture</title><shortdesc>This topic describes the architecture of keyboard drivers
       
    13 and related components.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    14 <p>This topic describes the architecture of keyboard drivers and related
       
    15 components on Symbian platform. </p>
       
    16 <p>There are five components involved in this process: </p>
       
    17 <ul>
       
    18 <li id="GUID-0C41EB6F-3AD4-5B89-863E-EA7E108C73C9"><p> <i> The keyboard
       
    19 hardware</i>. </p> </li>
       
    20 <li id="GUID-F965ADEC-3367-509F-A1B2-C5A5613410F6"><p> <i> A keyboard
       
    21 device driver</i>. </p> <p>The keyboard driver is implemented as a
       
    22 standard kernel extension, and is loaded by the kernel at boot time.
       
    23 A keyboard driver must be implemented in the base port, and has no
       
    24 platform independent parts. </p> </li>
       
    25 <li id="GUID-CBF257DE-AB08-5B96-AC15-E9981EA3484D"><p> <i>A keyboard
       
    26 mapping DLL</i>. </p> <p>A keyboard mapping DLL provides a set of
       
    27 lookup tables that map codes for the hardware keys to standard logical
       
    28 keycodes that user-side applications can process. </p> <p>The DLL
       
    29 is platform specific. It must be implemented in the base port, and
       
    30 has no platform independent parts. It is usually called <filepath>ekdata.dll</filepath>. </p> </li>
       
    31 <li id="GUID-52F97FEE-9B5B-5046-BF0C-EF1E4E2EB2BC"><p> <i>The Window
       
    32 Server</i>. </p> <p>The Window Server is a system server that manages
       
    33 access to the screen and input devices for user-side programs. </p> </li>
       
    34 <li id="GUID-216989CD-45CE-5F59-831B-03B49BE4E73D"><p> <i>The keyboard
       
    35 translator</i>. </p> <p>The keyboard translator DLL translates scancodes
       
    36 into keycodes using the data in the platform specific keyboard mapping
       
    37 DLL. </p> <p>It is part of Symbian platform generic code and is built
       
    38 as part of the Text Window Server component. </p> </li>
       
    39 </ul>
       
    40 <p>The following diagram shows how these components fit together and
       
    41 gives an overview of the data flow. </p>
       
    42 <fig id="GUID-D05ABF3B-3A1D-5F02-B268-FC1A992EE4DB">
       
    43 <title>Overview of data flow</title>
       
    44 <image href="GUID-9CC514E9-85C2-5F4B-9F3B-F9FA1F4CB20A_d0e14358_href.png" placement="inline"/>
       
    45 </fig>
       
    46 <p>Depending on the keyboard hardware, key presses in the form of
       
    47 key-down and key-up events are registered by the keyboard driver,
       
    48 either as a result of hardware interrupts, or as a result of polling
       
    49 the hardware. The driver assigns a standard scancode value to the
       
    50 key. This is one of the values defined by the <xref href="GUID-4D92CE24-E651-3584-BDE0-F26046B4175B.dita"><apiname>TStdScanCode</apiname></xref> enum. The value is a representation of the hardware key. </p>
       
    51 <p>The driver creates <xref href="GUID-668CEA36-3933-3BBE-A980-CAB62617B4FD.dita"><apiname>TRawEvent</apiname></xref> objects, of type <xref href="GUID-668CEA36-3933-3BBE-A980-CAB62617B4FD.dita#GUID-668CEA36-3933-3BBE-A980-CAB62617B4FD/GUID-ED6DCE25-227F-3353-8BE8-1C8F735198A8"><apiname>TRawEvent::EKeyUp</apiname></xref> and <xref href="GUID-9398BE98-2C09-333C-97D3-EFAD86400F8F.dita"><apiname>TRawEvent:EKeyDown</apiname></xref>, and includes the standard scancode value and modifiers as part
       
    52 of the object. These objects are added to the kernel's event queue,
       
    53 using the <xref href="GUID-C6946ECB-775F-3EC2-A56F-78F25B9FBE3D.dita#GUID-C6946ECB-775F-3EC2-A56F-78F25B9FBE3D/GUID-81C82FED-0E26-351A-901E-806843C808FE"><apiname>Kern::AddEvent()</apiname></xref> function. </p>
       
    54 <p>The Window Server captures these events and passes the scancode
       
    55 value to <filepath>ektran.dll</filepath>, which has the responsibility
       
    56 for translating this value into a keycode value. A keycode value is
       
    57 a logical representation of the key; it is this logical representation
       
    58 that has meaning for the generic Symbian platform. The logical keycode
       
    59 is one of the values defined by the <xref href="GUID-B67B6ED5-6C8F-3B36-934C-B47A109A515F.dita"><apiname>TKeyCode</apiname></xref> enum.
       
    60 Also, <filepath>ektran.dll</filepath> tells the Window Server whether
       
    61 a capture key has been pressed - this is explained in <xref href="GUID-110DB7EF-5E85-5BC4-9BBB-9A37B2D0C3A6.dita">Dynamic Behaviour</xref>. </p>
       
    62 <p> <filepath>ekdata.dll</filepath> encapsulates a set of tables that
       
    63 are used to map hardware scancodes to logical keycode values. This
       
    64 is platform specific code, and is used by the generic <filepath>ektran.dll</filepath> when doing the translation. </p>
       
    65 </conbody></concept>