stifui/avkon/uitestserverstarter/src/EventUtil.cpp
changeset 0 39ab869ed429
equal deleted inserted replaced
-1:000000000000 0:39ab869ed429
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 * 
       
    14 * Description: This module contains the implementation of 
       
    15 * CAknUiEnvProxy class member functions.
       
    16 *
       
    17 */
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "EventUtil.h"
       
    21 #include <e32def.h>
       
    22 #include <e32keys.h>
       
    23 #include <w32std.h>
       
    24 
       
    25 // EXTERNAL DATA STRUCTURES
       
    26 // None
       
    27 
       
    28 // EXTERNAL FUNCTION PROTOTYPES  
       
    29 // None
       
    30 
       
    31 // CONSTANTS
       
    32 // None
       
    33 
       
    34 // MACROS
       
    35 
       
    36 /**
       
    37  * Key code names definition macro
       
    38  */
       
    39 #define DefineKeyCodeNames( varName ) 			\
       
    40 	static TText* const varName[] =				\
       
    41         {										\
       
    42         (TText*)L"ekeynull",			\
       
    43         (TText*)L"ekeybell",			\
       
    44         (TText*)L"ekeybackspace",		\
       
    45         (TText*)L"ekeytab",				\
       
    46         (TText*)L"ekeylinefeed",		\
       
    47         (TText*)L"ekeyverticaltab",		\
       
    48         (TText*)L"ekeyformfeed",		\
       
    49         (TText*)L"ekeyenter",			\
       
    50         (TText*)L"ekeyescape",			\
       
    51         (TText*)L"ekeyspace",			\
       
    52         (TText*)L"ekeydelete",			\
       
    53         (TText*)L"ekeyprintscreen",		\
       
    54         (TText*)L"ekeypause",			\
       
    55         (TText*)L"ekeyhome",			\
       
    56         (TText*)L"ekeyend",				\
       
    57         (TText*)L"ekeypageup",			\
       
    58         (TText*)L"ekeypagedown",		\
       
    59         (TText*)L"ekeyinsert",			\
       
    60         (TText*)L"ekeyleftarrow",		\
       
    61         (TText*)L"ekeyrightarrow",		\
       
    62         (TText*)L"ekeyuparrow",			\
       
    63         (TText*)L"ekeydownarrow",		\
       
    64         (TText*)L"ekeyleftshift",		\
       
    65         (TText*)L"ekeyrightshift",		\
       
    66         (TText*)L"ekeyleftalt",			\
       
    67         (TText*)L"ekeyrightalt",		\
       
    68         (TText*)L"ekeyleftctrl",		\
       
    69         (TText*)L"ekeyrightctrl",		\
       
    70         (TText*)L"ekeyleftfunc",		\
       
    71         (TText*)L"ekeyrightfunc",		\
       
    72         (TText*)L"ekeycapslock",		\
       
    73         (TText*)L"ekeynumlock",			\
       
    74         (TText*)L"ekeyscrolllock",		\
       
    75         (TText*)L"ekeyf1",				\
       
    76         (TText*)L"ekeyf2",				\
       
    77         (TText*)L"ekeyf3",				\
       
    78         (TText*)L"ekeyf4",				\
       
    79         (TText*)L"ekeyf5",				\
       
    80         (TText*)L"ekeyf6",				\
       
    81         (TText*)L"ekeyf7",				\
       
    82         (TText*)L"ekeyf8",				\
       
    83         (TText*)L"ekeyf9",				\
       
    84         (TText*)L"ekeyf10",				\
       
    85         (TText*)L"ekeyf11",				\
       
    86         (TText*)L"ekeyf12",				\
       
    87         (TText*)L"ekeyf13",				\
       
    88         (TText*)L"ekeyf14",				\
       
    89         (TText*)L"ekeyf15",				\
       
    90         (TText*)L"ekeyf16",				\
       
    91         (TText*)L"ekeyf17",				\
       
    92         (TText*)L"ekeyf18",				\
       
    93         (TText*)L"ekeyf19",				\
       
    94         (TText*)L"ekeyf20",				\
       
    95         (TText*)L"ekeyf21",				\
       
    96         (TText*)L"ekeyf22",				\
       
    97         (TText*)L"ekeyf23",				\
       
    98         (TText*)L"ekeyf24",				\
       
    99         (TText*)L"ekeyoff",				\
       
   100         (TText*)L"ekeyinccontrast",		\
       
   101         (TText*)L"ekeydeccontrast",		\
       
   102         (TText*)L"ekeybacklighton",		\
       
   103         (TText*)L"ekeybacklightoff",	\
       
   104         (TText*)L"ekeybacklighttoggle",	\
       
   105         (TText*)L"ekeysliderdown",		\
       
   106         (TText*)L"ekeysliderup",		\
       
   107         (TText*)L"ekeymenu",			\
       
   108         (TText*)L"ekeydictaphoneplay",	\
       
   109         (TText*)L"ekeydictaphonestop",	\
       
   110         (TText*)L"ekeydictaphonerecord",\
       
   111         (TText*)L"ekeyhelp",			\
       
   112         (TText*)L"ekeydial",			\
       
   113         (TText*)L"ekeyscreendimension0",\
       
   114         (TText*)L"ekeyscreendimension1",\
       
   115         (TText*)L"ekeyscreendimension2",\
       
   116         (TText*)L"ekeyscreendimension3",\
       
   117         (TText*)L"ekeyincvolume",		\
       
   118         (TText*)L"ekeydecvolume",		\
       
   119         (TText*)L"ekeydevice0",			\
       
   120         (TText*)L"ekeydevice1",			\
       
   121         (TText*)L"ekeydevice2",			\
       
   122         (TText*)L"ekeydevice3",			\
       
   123         (TText*)L"ekeydevice4",			\
       
   124         (TText*)L"ekeydevice5",			\
       
   125         (TText*)L"ekeydevice6",			\
       
   126         (TText*)L"ekeydevice7",			\
       
   127         (TText*)L"ekeydevice8",			\
       
   128         (TText*)L"ekeydevice9",			\
       
   129         (TText*)L"ekeydevicea",			\
       
   130         (TText*)L"ekeydeviceb",			\
       
   131         (TText*)L"ekeydevicec",			\
       
   132         (TText*)L"ekeydeviced",			\
       
   133         (TText*)L"ekeydevicee",			\
       
   134         (TText*)L"ekeydevicef",			\
       
   135         (TText*)L"ekeyapplication0",	\
       
   136         (TText*)L"ekeyapplication1",	\
       
   137         (TText*)L"ekeyapplication2",	\
       
   138         (TText*)L"ekeyapplication3",	\
       
   139         (TText*)L"ekeyapplication4",	\
       
   140         (TText*)L"ekeyapplication5",	\
       
   141         (TText*)L"ekeyapplication6",	\
       
   142         (TText*)L"ekeyapplication7",	\
       
   143         (TText*)L"ekeyapplication8",	\
       
   144         (TText*)L"ekeyapplication9",	\
       
   145         (TText*)L"ekeyapplicationa",	\
       
   146         (TText*)L"ekeyapplicationb",	\
       
   147         (TText*)L"ekeyapplicationc",	\
       
   148         (TText*)L"ekeyapplicationd",	\
       
   149         (TText*)L"ekeyapplicatione",	\
       
   150         (TText*)L"ekeyapplicationf",	\
       
   151         (TText*)L"ekeyyes",				\
       
   152         (TText*)L"ekeyno",				\
       
   153         (TText*)L"ekeyincbrightness",	\
       
   154         (TText*)L"ekeydecbrightness",	\
       
   155         (TText*)L"ekeykeyboardextend",	\
       
   156         (TText*)L"ekeydevice10",		\
       
   157         (TText*)L"ekeydevice11",		\
       
   158         (TText*)L"ekeydevice12",		\
       
   159         (TText*)L"ekeydevice13",		\
       
   160         (TText*)L"ekeydevice14",		\
       
   161         (TText*)L"ekeydevice15",		\
       
   162         (TText*)L"ekeydevice16",		\
       
   163         (TText*)L"ekeydevice17",		\
       
   164         (TText*)L"ekeydevice18",		\
       
   165         (TText*)L"ekeydevice19",		\
       
   166         (TText*)L"ekeydevice1a",		\
       
   167         (TText*)L"ekeydevice1b",		\
       
   168         (TText*)L"ekeydevice1c",		\
       
   169         (TText*)L"ekeydevice1d",		\
       
   170         (TText*)L"ekeydevice1e",		\
       
   171         (TText*)L"ekeydevice1f",		\
       
   172         (TText*)L"ekeyapplication10",	\
       
   173         (TText*)L"ekeyapplication11",	\
       
   174         (TText*)L"ekeyapplication12",	\
       
   175         (TText*)L"ekeyapplication13",	\
       
   176         (TText*)L"ekeyapplication14",	\
       
   177         (TText*)L"ekeyapplication15",	\
       
   178         (TText*)L"ekeyapplication16",	\
       
   179         (TText*)L"ekeyapplication17",	\
       
   180         (TText*)L"ekeyapplication18",	\
       
   181         (TText*)L"ekeyapplication19",	\
       
   182         (TText*)L"ekeyapplication1a",	\
       
   183         (TText*)L"ekeyapplication1b",	\
       
   184         (TText*)L"ekeyapplication1c",	\
       
   185         (TText*)L"ekeyapplication1d",	\
       
   186         (TText*)L"ekeyapplication1e",	\
       
   187         (TText*)L"ekeyapplication1f",	\
       
   188         }
       
   189 
       
   190 /**
       
   191  * Key codes definition macro
       
   192  */
       
   193 #define DefineKeyCodes( varName )		\
       
   194 	static TUint const varName[] = 		\
       
   195 		{								\
       
   196         (TUint)EKeyNull,				\
       
   197         (TUint)EKeyBell,				\
       
   198         (TUint)EKeyBackspace,			\
       
   199         (TUint)EKeyTab,					\
       
   200         (TUint)EKeyLineFeed,			\
       
   201         (TUint)EKeyVerticalTab,			\
       
   202         (TUint)EKeyFormFeed,			\
       
   203         (TUint)EKeyEnter,				\
       
   204         (TUint)EKeyEscape,				\
       
   205         (TUint)EKeySpace,				\
       
   206         (TUint)EKeyDelete,				\
       
   207         (TUint)EKeyPrintScreen,			\
       
   208         (TUint)EKeyPause,				\
       
   209         (TUint)EKeyHome,				\
       
   210         (TUint)EKeyEnd,					\
       
   211         (TUint)EKeyPageUp,				\
       
   212         (TUint)EKeyPageDown,			\
       
   213         (TUint)EKeyInsert,				\
       
   214         (TUint)EKeyLeftArrow,			\
       
   215         (TUint)EKeyRightArrow,			\
       
   216         (TUint)EKeyUpArrow,				\
       
   217         (TUint)EKeyDownArrow,			\
       
   218         (TUint)EKeyLeftShift,			\
       
   219         (TUint)EKeyRightShift,			\
       
   220         (TUint)EKeyLeftAlt,				\
       
   221         (TUint)EKeyRightAlt,			\
       
   222         (TUint)EKeyLeftCtrl,			\
       
   223         (TUint)EKeyRightCtrl,			\
       
   224         (TUint)EKeyLeftFunc,			\
       
   225         (TUint)EKeyRightFunc,			\
       
   226         (TUint)EKeyCapsLock,			\
       
   227         (TUint)EKeyNumLock,				\
       
   228         (TUint)EKeyScrollLock,			\
       
   229         (TUint)EKeyF1,					\
       
   230         (TUint)EKeyF2,					\
       
   231         (TUint)EKeyF3,					\
       
   232         (TUint)EKeyF4,					\
       
   233         (TUint)EKeyF5,					\
       
   234         (TUint)EKeyF6,					\
       
   235         (TUint)EKeyF7,					\
       
   236         (TUint)EKeyF8,					\
       
   237         (TUint)EKeyF9,					\
       
   238         (TUint)EKeyF10,					\
       
   239         (TUint)EKeyF11,					\
       
   240         (TUint)EKeyF12,					\
       
   241         (TUint)EKeyF13,					\
       
   242         (TUint)EKeyF14,					\
       
   243         (TUint)EKeyF15,					\
       
   244         (TUint)EKeyF16,					\
       
   245         (TUint)EKeyF17,					\
       
   246         (TUint)EKeyF18,					\
       
   247         (TUint)EKeyF19,					\
       
   248         (TUint)EKeyF20,					\
       
   249         (TUint)EKeyF21,					\
       
   250         (TUint)EKeyF22,					\
       
   251         (TUint)EKeyF23,					\
       
   252         (TUint)EKeyF24,					\
       
   253         (TUint)EKeyOff,					\
       
   254         (TUint)EKeyIncContrast,			\
       
   255         (TUint)EKeyDecContrast,			\
       
   256         (TUint)EKeyBacklightOn,			\
       
   257         (TUint)EKeyBacklightOff,		\
       
   258         (TUint)EKeyBacklightToggle,		\
       
   259         (TUint)EKeySliderDown,			\
       
   260         (TUint)EKeySliderUp,			\
       
   261         (TUint)EKeyMenu,				\
       
   262         (TUint)EKeyDictaphonePlay,		\
       
   263         (TUint)EKeyDictaphoneStop,		\
       
   264         (TUint)EKeyDictaphoneRecord,	\
       
   265         (TUint)EKeyHelp,				\
       
   266         (TUint)EKeyDial,				\
       
   267         (TUint)EKeyScreenDimension0,	\
       
   268         (TUint)EKeyScreenDimension1,	\
       
   269         (TUint)EKeyScreenDimension2,	\
       
   270         (TUint)EKeyScreenDimension3,	\
       
   271         (TUint)EKeyIncVolume,			\
       
   272         (TUint)EKeyDecVolume,			\
       
   273         (TUint)EKeyDevice0,				\
       
   274         (TUint)EKeyDevice1,				\
       
   275         (TUint)EKeyDevice2,				\
       
   276         (TUint)EKeyDevice3,				\
       
   277         (TUint)EKeyDevice4,				\
       
   278         (TUint)EKeyDevice5,				\
       
   279         (TUint)EKeyDevice6,				\
       
   280         (TUint)EKeyDevice7,				\
       
   281         (TUint)EKeyDevice8,				\
       
   282         (TUint)EKeyDevice9,				\
       
   283         (TUint)EKeyDeviceA,				\
       
   284         (TUint)EKeyDeviceB,				\
       
   285         (TUint)EKeyDeviceC,				\
       
   286         (TUint)EKeyDeviceD,				\
       
   287         (TUint)EKeyDeviceE,				\
       
   288         (TUint)EKeyDeviceF,				\
       
   289         (TUint)EKeyApplication0,		\
       
   290         (TUint)EKeyApplication1,		\
       
   291         (TUint)EKeyApplication2,		\
       
   292         (TUint)EKeyApplication3,		\
       
   293         (TUint)EKeyApplication4,		\
       
   294         (TUint)EKeyApplication5,		\
       
   295         (TUint)EKeyApplication6,		\
       
   296         (TUint)EKeyApplication7,		\
       
   297         (TUint)EKeyApplication8,		\
       
   298         (TUint)EKeyApplication9,		\
       
   299         (TUint)EKeyApplicationA,		\
       
   300         (TUint)EKeyApplicationB,		\
       
   301         (TUint)EKeyApplicationC,		\
       
   302         (TUint)EKeyApplicationD,		\
       
   303         (TUint)EKeyApplicationE,		\
       
   304         (TUint)EKeyApplicationF,		\
       
   305         (TUint)EKeyYes,					\
       
   306         (TUint)EKeyNo,					\
       
   307         (TUint)EKeyIncBrightness,		\
       
   308         (TUint)EKeyDecBrightness,		\
       
   309         (TUint)EKeyKeyboardExtend,		\
       
   310         (TUint)EKeyDevice10,			\
       
   311         (TUint)EKeyDevice11,			\
       
   312         (TUint)EKeyDevice12,			\
       
   313         (TUint)EKeyDevice13,			\
       
   314         (TUint)EKeyDevice14,			\
       
   315         (TUint)EKeyDevice15,			\
       
   316         (TUint)EKeyDevice16,			\
       
   317         (TUint)EKeyDevice17,			\
       
   318         (TUint)EKeyDevice18,			\
       
   319         (TUint)EKeyDevice19,			\
       
   320         (TUint)EKeyDevice1A,			\
       
   321         (TUint)EKeyDevice1B,			\
       
   322         (TUint)EKeyDevice1C,			\
       
   323         (TUint)EKeyDevice1D,			\
       
   324         (TUint)EKeyDevice1E,			\
       
   325         (TUint)EKeyDevice1F,			\
       
   326         (TUint)EKeyApplication10,		\
       
   327         (TUint)EKeyApplication11,		\
       
   328         (TUint)EKeyApplication12,		\
       
   329         (TUint)EKeyApplication13,		\
       
   330         (TUint)EKeyApplication14,		\
       
   331         (TUint)EKeyApplication15,		\
       
   332         (TUint)EKeyApplication16,		\
       
   333         (TUint)EKeyApplication17,		\
       
   334         (TUint)EKeyApplication18,		\
       
   335         (TUint)EKeyApplication19,		\
       
   336         (TUint)EKeyApplication1A,		\
       
   337         (TUint)EKeyApplication1B,		\
       
   338         (TUint)EKeyApplication1C,		\
       
   339         (TUint)EKeyApplication1D,		\
       
   340         (TUint)EKeyApplication1E,		\
       
   341         (TUint)EKeyApplication1F,		\
       
   342 		}
       
   343 
       
   344 /**
       
   345  * Key scan code names definition macro.
       
   346  */
       
   347 #define DefineKeyScanCodeNames( varName ) 			\
       
   348 	static TText* const varName[] =					\
       
   349         {											\
       
   350         (TText*)L"estdkeynull",						\
       
   351         (TText*)L"estdkeybackspace",				\
       
   352         (TText*)L"estdkeytab",						\
       
   353         (TText*)L"estdkeyenter",					\
       
   354         (TText*)L"estdkeyescape",					\
       
   355         (TText*)L"estdkeyspace",					\
       
   356         (TText*)L"estdkeyprintscreen",				\
       
   357         (TText*)L"estdkeypause",					\
       
   358         (TText*)L"estdkeyhome",						\
       
   359         (TText*)L"estdkeyend",						\
       
   360         (TText*)L"estdkeypageup",					\
       
   361         (TText*)L"estdkeypagedown",					\
       
   362         (TText*)L"estdkeyinsert",					\
       
   363         (TText*)L"estdkeydelete",					\
       
   364         (TText*)L"estdkeyleftarrow",				\
       
   365         (TText*)L"estdkeyrightarrow",				\
       
   366         (TText*)L"estdkeyuparrow",					\
       
   367         (TText*)L"estdkeydownarrow",				\
       
   368         (TText*)L"estdkeyleftshift",				\
       
   369         (TText*)L"estdkeyrightshift",				\
       
   370         (TText*)L"estdkeyleftalt",					\
       
   371         (TText*)L"estdkeyrightalt",					\
       
   372         (TText*)L"estdkeyleftctrl",					\
       
   373         (TText*)L"estdkeyrightctrl",				\
       
   374         (TText*)L"estdkeyleftfunc",					\
       
   375         (TText*)L"estdkeyrightfunc",				\
       
   376         (TText*)L"estdkeycapslock",					\
       
   377         (TText*)L"estdkeynumlock",					\
       
   378         (TText*)L"estdkeyscrolllock",				\
       
   379         (TText*)L"estdkeyf1",						\
       
   380         (TText*)L"estdkeyf2",						\
       
   381         (TText*)L"estdkeyf3",						\
       
   382         (TText*)L"estdkeyf4",						\
       
   383         (TText*)L"estdkeyf5",						\
       
   384         (TText*)L"estdkeyf6",						\
       
   385         (TText*)L"estdkeyf7",						\
       
   386         (TText*)L"estdkeyf8",						\
       
   387         (TText*)L"estdkeyf9",						\
       
   388         (TText*)L"estdkeyf10",						\
       
   389         (TText*)L"estdkeyf11",						\
       
   390         (TText*)L"estdkeyf12",						\
       
   391         (TText*)L"estdkeyf13",						\
       
   392         (TText*)L"estdkeyf14",						\
       
   393         (TText*)L"estdkeyf15",						\
       
   394         (TText*)L"estdkeyf16",						\
       
   395         (TText*)L"estdkeyf17",						\
       
   396         (TText*)L"estdkeyf18",						\
       
   397         (TText*)L"estdkeyf19",						\
       
   398         (TText*)L"estdkeyf20",						\
       
   399         (TText*)L"estdkeyf21",						\
       
   400         (TText*)L"estdkeyf22",						\
       
   401         (TText*)L"estdkeyf23",						\
       
   402         (TText*)L"estdkeyf24",						\
       
   403         (TText*)L"estdkeyxxx",						\
       
   404         (TText*)L"estdkeycomma",					\
       
   405         (TText*)L"estdkeyfullstop",					\
       
   406         (TText*)L"estdkeyforwardslash",				\
       
   407         (TText*)L"estdkeybackslash",				\
       
   408         (TText*)L"estdkeysemicolon",				\
       
   409         (TText*)L"estdkeysinglequote",				\
       
   410         (TText*)L"estdkeyhash",						\
       
   411         (TText*)L"estdkeysquarebracketleft",		\
       
   412         (TText*)L"estdkeysquarebracketright",		\
       
   413         (TText*)L"estdkeyminus",					\
       
   414         (TText*)L"estdkeyequals",					\
       
   415         (TText*)L"estdkeynkpforwardslash",			\
       
   416         (TText*)L"estdkeynkpasterisk",				\
       
   417         (TText*)L"estdkeynkpminus",					\
       
   418         (TText*)L"estdkeynkpplus",					\
       
   419         (TText*)L"estdkeynkpenter",					\
       
   420         (TText*)L"estdkeynkp1",						\
       
   421         (TText*)L"estdkeynkp2",						\
       
   422         (TText*)L"estdkeynkp3",						\
       
   423         (TText*)L"estdkeynkp4",						\
       
   424         (TText*)L"estdkeynkp5",						\
       
   425         (TText*)L"estdkeynkp6",						\
       
   426         (TText*)L"estdkeynkp7",						\
       
   427         (TText*)L"estdkeynkp8",						\
       
   428         (TText*)L"estdkeynkp9",						\
       
   429         (TText*)L"estdkeynkp0",						\
       
   430         (TText*)L"estdkeynkpfullstop",				\
       
   431         (TText*)L"estdkeymenu",						\
       
   432         (TText*)L"estdkeybacklighton",				\
       
   433         (TText*)L"estdkeybacklightoff",				\
       
   434         (TText*)L"estdkeybacklighttoggle",			\
       
   435         (TText*)L"estdkeyinccontrast",				\
       
   436         (TText*)L"estdkeydeccontrast",				\
       
   437         (TText*)L"estdkeysliderdown",				\
       
   438         (TText*)L"estdkeysliderup",					\
       
   439         (TText*)L"estdkeydictaphoneplay",			\
       
   440         (TText*)L"estdkeydictaphonestop",			\
       
   441         (TText*)L"estdkeydictaphonerecord",			\
       
   442         (TText*)L"estdkeyhelp",						\
       
   443         (TText*)L"estdkeyoff",						\
       
   444         (TText*)L"estdkeydial",						\
       
   445         (TText*)L"estdkeyincvolume",				\
       
   446         (TText*)L"estdkeydecvolume",				\
       
   447         (TText*)L"estdkeydevice0",					\
       
   448         (TText*)L"estdkeydevice1",					\
       
   449         (TText*)L"estdkeydevice2",					\
       
   450         (TText*)L"estdkeydevice3",					\
       
   451         (TText*)L"estdkeydevice4",					\
       
   452         (TText*)L"estdkeydevice5",					\
       
   453         (TText*)L"estdkeydevice6",					\
       
   454         (TText*)L"estdkeydevice7",					\
       
   455         (TText*)L"estdkeydevice8",					\
       
   456         (TText*)L"estdkeydevice9",					\
       
   457         (TText*)L"estdkeydevicea",					\
       
   458         (TText*)L"estdkeydeviceb",					\
       
   459         (TText*)L"estdkeydevicec",					\
       
   460         (TText*)L"estdkeydeviced",					\
       
   461         (TText*)L"estdkeydevicee",					\
       
   462         (TText*)L"estdkeydevicef",					\
       
   463         (TText*)L"estdkeyapplication0",				\
       
   464         (TText*)L"estdkeyapplication1",				\
       
   465         (TText*)L"estdkeyapplication2",				\
       
   466         (TText*)L"estdkeyapplication3",				\
       
   467         (TText*)L"estdkeyapplication4",				\
       
   468         (TText*)L"estdkeyapplication5",				\
       
   469         (TText*)L"estdkeyapplication6",				\
       
   470         (TText*)L"estdkeyapplication7",				\
       
   471         (TText*)L"estdkeyapplication8",				\
       
   472         (TText*)L"estdkeyapplication9",				\
       
   473         (TText*)L"estdkeyapplicationa",				\
       
   474         (TText*)L"estdkeyapplicationb",				\
       
   475         (TText*)L"estdkeyapplicationc",				\
       
   476         (TText*)L"estdkeyapplicationd",				\
       
   477         (TText*)L"estdkeyapplicatione",				\
       
   478         (TText*)L"estdkeyapplicationf",				\
       
   479         (TText*)L"estdkeyyes",						\
       
   480         (TText*)L"estdkeyno",						\
       
   481         (TText*)L"estdkeyincbrightness",			\
       
   482         (TText*)L"estdkeydecbrightness",			\
       
   483         (TText*)L"estdkeykeyboardextend",			\
       
   484         (TText*)L"estdkeydevice10",					\
       
   485         (TText*)L"estdkeydevice11",					\
       
   486         (TText*)L"estdkeydevice12",					\
       
   487         (TText*)L"estdkeydevice13",					\
       
   488         (TText*)L"estdkeydevice14",					\
       
   489         (TText*)L"estdkeydevice15",					\
       
   490         (TText*)L"estdkeydevice16",					\
       
   491         (TText*)L"estdkeydevice17",					\
       
   492         (TText*)L"estdkeydevice18",					\
       
   493         (TText*)L"estdkeydevice19",					\
       
   494         (TText*)L"estdkeydevice1a",					\
       
   495         (TText*)L"estdkeydevice1b",					\
       
   496         (TText*)L"estdkeydevice1c",					\
       
   497         (TText*)L"estdkeydevice1d",					\
       
   498         (TText*)L"estdkeydevice1e",					\
       
   499         (TText*)L"estdkeydevice1f",					\
       
   500         (TText*)L"estdkeyapplication10",			\
       
   501         (TText*)L"estdkeyapplication11",			\
       
   502         (TText*)L"estdkeyapplication12",			\
       
   503         (TText*)L"estdkeyapplication13",			\
       
   504         (TText*)L"estdkeyapplication14",			\
       
   505         (TText*)L"estdkeyapplication15",			\
       
   506         (TText*)L"estdkeyapplication16",			\
       
   507         (TText*)L"estdkeyapplication17",			\
       
   508         (TText*)L"estdkeyapplication18",			\
       
   509         (TText*)L"estdkeyapplication19",			\
       
   510         (TText*)L"estdkeyapplication1a",			\
       
   511         (TText*)L"estdkeyapplication1b",			\
       
   512         (TText*)L"estdkeyapplication1c",			\
       
   513         (TText*)L"estdkeyapplication1d",			\
       
   514         (TText*)L"estdkeyapplication1e",			\
       
   515         (TText*)L"estdkeyapplication1f",			\
       
   516         }
       
   517 
       
   518 /**
       
   519  * Key scan codes definition macro.
       
   520  */
       
   521 #define DefineKeyScanCodes( varName )		\
       
   522 	static TUint const varName[] = 			\
       
   523 		{									\
       
   524         (TUint)EStdKeyNull,					\
       
   525         (TUint)EStdKeyBackspace,			\
       
   526         (TUint)EStdKeyTab,					\
       
   527         (TUint)EStdKeyEnter,				\
       
   528         (TUint)EStdKeyEscape,				\
       
   529         (TUint)EStdKeySpace,				\
       
   530         (TUint)EStdKeyPrintScreen,			\
       
   531         (TUint)EStdKeyPause,				\
       
   532         (TUint)EStdKeyHome,					\
       
   533         (TUint)EStdKeyEnd,					\
       
   534         (TUint)EStdKeyPageUp,				\
       
   535         (TUint)EStdKeyPageDown,				\
       
   536         (TUint)EStdKeyInsert,				\
       
   537         (TUint)EStdKeyDelete,				\
       
   538         (TUint)EStdKeyLeftArrow,			\
       
   539         (TUint)EStdKeyRightArrow,			\
       
   540         (TUint)EStdKeyUpArrow,				\
       
   541         (TUint)EStdKeyDownArrow,			\
       
   542         (TUint)EStdKeyLeftShift,			\
       
   543         (TUint)EStdKeyRightShift,			\
       
   544         (TUint)EStdKeyLeftAlt,				\
       
   545         (TUint)EStdKeyRightAlt,				\
       
   546         (TUint)EStdKeyLeftCtrl,				\
       
   547         (TUint)EStdKeyRightCtrl,			\
       
   548         (TUint)EStdKeyLeftFunc,				\
       
   549         (TUint)EStdKeyRightFunc,			\
       
   550         (TUint)EStdKeyCapsLock,				\
       
   551         (TUint)EStdKeyNumLock,				\
       
   552         (TUint)EStdKeyScrollLock,			\
       
   553         (TUint)EStdKeyF1,					\
       
   554         (TUint)EStdKeyF2,					\
       
   555         (TUint)EStdKeyF3,					\
       
   556         (TUint)EStdKeyF4,					\
       
   557         (TUint)EStdKeyF5,					\
       
   558         (TUint)EStdKeyF6,					\
       
   559         (TUint)EStdKeyF7,					\
       
   560         (TUint)EStdKeyF8,					\
       
   561         (TUint)EStdKeyF9,					\
       
   562         (TUint)EStdKeyF10,					\
       
   563         (TUint)EStdKeyF11,					\
       
   564         (TUint)EStdKeyF12,					\
       
   565         (TUint)EStdKeyF13,					\
       
   566         (TUint)EStdKeyF14,					\
       
   567         (TUint)EStdKeyF15,					\
       
   568         (TUint)EStdKeyF16,					\
       
   569         (TUint)EStdKeyF17,					\
       
   570         (TUint)EStdKeyF18,					\
       
   571         (TUint)EStdKeyF19,					\
       
   572         (TUint)EStdKeyF20,					\
       
   573         (TUint)EStdKeyF21,					\
       
   574         (TUint)EStdKeyF22,					\
       
   575         (TUint)EStdKeyF23,					\
       
   576         (TUint)EStdKeyF24,					\
       
   577         (TUint)EStdKeyXXX,					\
       
   578         (TUint)EStdKeyComma,				\
       
   579         (TUint)EStdKeyFullStop,				\
       
   580         (TUint)EStdKeyForwardSlash,			\
       
   581         (TUint)EStdKeyBackSlash,			\
       
   582         (TUint)EStdKeySemiColon,			\
       
   583         (TUint)EStdKeySingleQuote,			\
       
   584         (TUint)EStdKeyHash,					\
       
   585         (TUint)EStdKeySquareBracketLeft,	\
       
   586         (TUint)EStdKeySquareBracketRight,	\
       
   587         (TUint)EStdKeyMinus,				\
       
   588         (TUint)EStdKeyEquals,				\
       
   589         (TUint)EStdKeyNkpForwardSlash,		\
       
   590         (TUint)EStdKeyNkpAsterisk,			\
       
   591         (TUint)EStdKeyNkpMinus,				\
       
   592         (TUint)EStdKeyNkpPlus,				\
       
   593         (TUint)EStdKeyNkpEnter,				\
       
   594         (TUint)EStdKeyNkp1,					\
       
   595         (TUint)EStdKeyNkp2,					\
       
   596         (TUint)EStdKeyNkp3,					\
       
   597         (TUint)EStdKeyNkp4,					\
       
   598         (TUint)EStdKeyNkp5,					\
       
   599         (TUint)EStdKeyNkp6,					\
       
   600         (TUint)EStdKeyNkp7,					\
       
   601         (TUint)EStdKeyNkp8,					\
       
   602         (TUint)EStdKeyNkp9,					\
       
   603         (TUint)EStdKeyNkp0,					\
       
   604         (TUint)EStdKeyNkpFullStop,			\
       
   605         (TUint)EStdKeyMenu,					\
       
   606         (TUint)EStdKeyBacklightOn,			\
       
   607         (TUint)EStdKeyBacklightOff,			\
       
   608         (TUint)EStdKeyBacklightToggle,		\
       
   609         (TUint)EStdKeyIncContrast,			\
       
   610         (TUint)EStdKeyDecContrast,			\
       
   611         (TUint)EStdKeySliderDown,			\
       
   612         (TUint)EStdKeySliderUp,				\
       
   613         (TUint)EStdKeyDictaphonePlay,		\
       
   614         (TUint)EStdKeyDictaphoneStop,		\
       
   615         (TUint)EStdKeyDictaphoneRecord,		\
       
   616         (TUint)EStdKeyHelp,					\
       
   617         (TUint)EStdKeyOff,					\
       
   618         (TUint)EStdKeyDial,					\
       
   619         (TUint)EStdKeyIncVolume,			\
       
   620         (TUint)EStdKeyDecVolume,			\
       
   621         (TUint)EStdKeyDevice0,				\
       
   622         (TUint)EStdKeyDevice1,				\
       
   623         (TUint)EStdKeyDevice2,				\
       
   624         (TUint)EStdKeyDevice3,				\
       
   625         (TUint)EStdKeyDevice4,				\
       
   626         (TUint)EStdKeyDevice5,				\
       
   627         (TUint)EStdKeyDevice6,				\
       
   628         (TUint)EStdKeyDevice7,				\
       
   629         (TUint)EStdKeyDevice8,				\
       
   630         (TUint)EStdKeyDevice9,				\
       
   631         (TUint)EStdKeyDeviceA,				\
       
   632         (TUint)EStdKeyDeviceB,				\
       
   633         (TUint)EStdKeyDeviceC,				\
       
   634         (TUint)EStdKeyDeviceD,				\
       
   635         (TUint)EStdKeyDeviceE,				\
       
   636         (TUint)EStdKeyDeviceF,				\
       
   637         (TUint)EStdKeyApplication0,			\
       
   638         (TUint)EStdKeyApplication1,			\
       
   639         (TUint)EStdKeyApplication2,			\
       
   640         (TUint)EStdKeyApplication3,			\
       
   641         (TUint)EStdKeyApplication4,			\
       
   642         (TUint)EStdKeyApplication5,			\
       
   643         (TUint)EStdKeyApplication6,			\
       
   644         (TUint)EStdKeyApplication7,			\
       
   645         (TUint)EStdKeyApplication8,			\
       
   646         (TUint)EStdKeyApplication9,			\
       
   647         (TUint)EStdKeyApplicationA,			\
       
   648         (TUint)EStdKeyApplicationB,			\
       
   649         (TUint)EStdKeyApplicationC,			\
       
   650         (TUint)EStdKeyApplicationD,			\
       
   651         (TUint)EStdKeyApplicationE,			\
       
   652         (TUint)EStdKeyApplicationF,			\
       
   653         (TUint)EStdKeyYes,					\
       
   654         (TUint)EStdKeyNo,					\
       
   655         (TUint)EStdKeyIncBrightness,		\
       
   656         (TUint)EStdKeyDecBrightness,		\
       
   657         (TUint)EStdKeyKeyboardExtend,		\
       
   658         (TUint)EStdKeyDevice10,				\
       
   659         (TUint)EStdKeyDevice11,				\
       
   660         (TUint)EStdKeyDevice12,				\
       
   661         (TUint)EStdKeyDevice13,				\
       
   662         (TUint)EStdKeyDevice14,				\
       
   663         (TUint)EStdKeyDevice15,				\
       
   664         (TUint)EStdKeyDevice16,				\
       
   665         (TUint)EStdKeyDevice17,				\
       
   666         (TUint)EStdKeyDevice18,				\
       
   667         (TUint)EStdKeyDevice19,				\
       
   668         (TUint)EStdKeyDevice1A,				\
       
   669         (TUint)EStdKeyDevice1B,				\
       
   670         (TUint)EStdKeyDevice1C,				\
       
   671         (TUint)EStdKeyDevice1D,				\
       
   672         (TUint)EStdKeyDevice1E,				\
       
   673         (TUint)EStdKeyDevice1F,				\
       
   674         (TUint)EStdKeyApplication10,		\
       
   675         (TUint)EStdKeyApplication11,		\
       
   676         (TUint)EStdKeyApplication12,		\
       
   677         (TUint)EStdKeyApplication13,		\
       
   678         (TUint)EStdKeyApplication14,		\
       
   679         (TUint)EStdKeyApplication15,		\
       
   680         (TUint)EStdKeyApplication16,		\
       
   681         (TUint)EStdKeyApplication17,		\
       
   682         (TUint)EStdKeyApplication18,		\
       
   683         (TUint)EStdKeyApplication19,		\
       
   684         (TUint)EStdKeyApplication1A,		\
       
   685         (TUint)EStdKeyApplication1B,		\
       
   686         (TUint)EStdKeyApplication1C,		\
       
   687         (TUint)EStdKeyApplication1D,		\
       
   688         (TUint)EStdKeyApplication1E,		\
       
   689         (TUint)EStdKeyApplication1F,		\
       
   690         }
       
   691 
       
   692 /**
       
   693  * Key modifier names definition macro.
       
   694  */
       
   695 #define DefineModifiers( varName )			\
       
   696 	static TUint const varName[] = 			\
       
   697 		{									\
       
   698         (TUint)EModifierAutorepeatable,		\
       
   699         (TUint)EModifierKeypad,				\
       
   700         (TUint)EModifierLeftAlt,			\
       
   701         (TUint)EModifierRightAlt,			\
       
   702         (TUint)EModifierAlt,				\
       
   703         (TUint)EModifierLeftCtrl,			\
       
   704         (TUint)EModifierRightCtrl,			\
       
   705         (TUint)EModifierCtrl,				\
       
   706         (TUint)EModifierLeftShift,			\
       
   707         (TUint)EModifierRightShift,			\
       
   708         (TUint)EModifierShift,				\
       
   709         (TUint)EModifierLeftFunc,			\
       
   710         (TUint)EModifierRightFunc,			\
       
   711         (TUint)EModifierFunc,				\
       
   712         (TUint)EModifierCapsLock,			\
       
   713         (TUint)EModifierNumLock,			\
       
   714         (TUint)EModifierScrollLock,			\
       
   715         (TUint)EModifierKeyUp,				\
       
   716         (TUint)EModifierSpecial,			\
       
   717         (TUint)EModifierDoubleClick,		\
       
   718         (TUint)EModifierPureKeycode,		\
       
   719         (TUint)EModifierKeyboardExtend,		\
       
   720         (TUint)EModifierCancelRotation,		\
       
   721         (TUint)EModifierRotateBy90,			\
       
   722         (TUint)EModifierRotateBy180,		\
       
   723         (TUint)EModifierRotateBy270,		\
       
   724         (TUint)EModifierPointer3DButton1,	\
       
   725         (TUint)EModifierPointer3DButton2,	\
       
   726         (TUint)EModifierPointer3DButton3,	\
       
   727         (TUint)EAllModifiers,				\
       
   728     }
       
   729 
       
   730 /**
       
   731  * Key modifiers definition macro.
       
   732  */
       
   733 #define DefineModifierNames( varName ) 				\
       
   734 	static TText* const varName[] =					\
       
   735         {											\
       
   736         (TText*)L"estdkeynull",						\
       
   737         (TText*)L"emodifierautorepeatable",			\
       
   738         (TText*)L"emodifierkeypad",					\
       
   739         (TText*)L"emodifierleftalt",				\
       
   740         (TText*)L"emodifierrightalt",				\
       
   741         (TText*)L"emodifieralt",					\
       
   742         (TText*)L"emodifierleftctrl",				\
       
   743         (TText*)L"emodifierrightctrl",				\
       
   744         (TText*)L"emodifierctrl",					\
       
   745         (TText*)L"emodifierleftshift",				\
       
   746         (TText*)L"emodifierrightshift",				\
       
   747         (TText*)L"emodifiershift",					\
       
   748         (TText*)L"emodifierleftfunc",				\
       
   749         (TText*)L"emodifierrightfunc",				\
       
   750         (TText*)L"emodifierfunc",					\
       
   751         (TText*)L"emodifiercapslock",				\
       
   752         (TText*)L"emodifiernumlock",				\
       
   753         (TText*)L"emodifierscrolllock",				\
       
   754         (TText*)L"emodifierkeyup",					\
       
   755         (TText*)L"emodifierspecial",				\
       
   756         (TText*)L"emodifierdoubleclick",			\
       
   757         (TText*)L"emodifierpurekeycode",			\
       
   758         (TText*)L"emodifierkeyboardextend",			\
       
   759         (TText*)L"emodifiercancelrotation",			\
       
   760         (TText*)L"emodifierrotateby90",				\
       
   761         (TText*)L"emodifierrotateby180",			\
       
   762         (TText*)L"emodifierrotateby270",			\
       
   763         (TText*)L"emodifierpointer3dbutton1",		\
       
   764         (TText*)L"emodifierpointer3dbutton2",		\
       
   765         (TText*)L"emodifierpointer3dbutton3",		\
       
   766         (TText*)L"eallmodifiers",					\
       
   767         }
       
   768         
       
   769 
       
   770 /**
       
   771  * Pointer event type names definition macro
       
   772  */
       
   773 #define DefinePointerEventTypeNames( varName ) 			\
       
   774 	static TText* const varName[] =						\
       
   775         {												\
       
   776         (TText*)L"epointermove",						\
       
   777         (TText*)L"epointerswitchon",							\
       
   778         (TText*)L"ebutton1down",						\
       
   779         (TText*)L"ebutton1up",							\
       
   780         (TText*)L"ebutton2down",						\
       
   781         (TText*)L"ebutton2up",							\
       
   782         (TText*)L"ebutton3down",						\
       
   783         (TText*)L"ebutton3up",							\
       
   784         (TText*)L"ebutton1",							\
       
   785         (TText*)L"ebutton2",							\
       
   786         (TText*)L"ebutton3",							\
       
   787         }
       
   788 
       
   789 /**
       
   790  * Pointer event type codes definition macro.
       
   791  */
       
   792 #define DefinePointerEventTypes( varName )					\
       
   793 	static TInt const varName[] = 							\
       
   794 		{													\
       
   795         (TUint)TRawEvent::EPointerMove,						\
       
   796         (TUint)TRawEvent::EPointerSwitchOn,					\
       
   797         (TUint)TRawEvent::EButton1Down,						\
       
   798         (TUint)TRawEvent::EButton1Up,						\
       
   799         (TUint)TRawEvent::EButton2Down,						\
       
   800         (TUint)TRawEvent::EButton2Up,						\
       
   801         (TUint)TRawEvent::EButton3Down,						\
       
   802         (TUint)TRawEvent::EButton3Up,						\
       
   803         (TUint)TEventUtil::EButton1,						\
       
   804         (TUint)TEventUtil::EButton2,						\
       
   805         (TUint)TEventUtil::EButton3,						\
       
   806 		}
       
   807 
       
   808 // LOCAL CONSTANTS AND MACROS
       
   809 // None
       
   810 
       
   811 // MODULE DATA STRUCTURES
       
   812 // None
       
   813 
       
   814 // LOCAL FUNCTION PROTOTYPES
       
   815 // None
       
   816 
       
   817 // FORWARD DECLARATIONS
       
   818 // None
       
   819 
       
   820 // ================= MEMBER FUNCTIONS =========================================
       
   821 
       
   822 /*
       
   823 -------------------------------------------------------------------------------
       
   824 
       
   825      Class: TEventUtil
       
   826 
       
   827      Method: GetKeyCodeName
       
   828 
       
   829      Description: Gets key name.
       
   830 
       
   831      Returns selected key name. 
       
   832 
       
   833      Parameters: TUint aKeyCode: out: Key code.
       
   834      
       
   835      Return Values: Key name.
       
   836 
       
   837      Errors/Exceptions: None.
       
   838 
       
   839      Status: Draft
       
   840     
       
   841 -------------------------------------------------------------------------------
       
   842 */
       
   843 TPtrC TEventUtil::GetKeyCodeName( TUint aKeyCode )
       
   844 	{
       
   845 	DefineKeyCodeNames( keyCodeNames );
       
   846 	DefineKeyCodes( keyCodes );
       
   847 	int keyCodeNamesCount = (sizeof( keyCodeNames )/sizeof(TText*));
       
   848 	
       
   849 	for ( int i = 0; i < keyCodeNamesCount; i++ ) {
       
   850 		if ( keyCodes[ i ] == aKeyCode ) 
       
   851 			{
       
   852 			return keyCodeNames[ i ];
       
   853 			}
       
   854 	}
       
   855 
       
   856 	return NULL;
       
   857 	}
       
   858 
       
   859 /*
       
   860 -------------------------------------------------------------------------------
       
   861 
       
   862      Class: TEventUtil
       
   863 
       
   864      Method: GetKeyScanCodeName
       
   865 
       
   866      Description: Gets key scan code name.
       
   867 
       
   868      Returns selected key scan code name. 
       
   869 
       
   870      Parameters: TUint aKeyCode: out: Key scan code.
       
   871      
       
   872      Return Values: Key scan code name.
       
   873 
       
   874      Errors/Exceptions: None.
       
   875 
       
   876      Status: Draft
       
   877     
       
   878 -------------------------------------------------------------------------------
       
   879 */
       
   880 TPtrC TEventUtil::GetKeyScanCodeName( TInt aKeyScanCode )
       
   881 	{	
       
   882 	DefineKeyScanCodeNames( keyScanCodeNames );
       
   883 	DefineKeyScanCodes( keyScanCodes );
       
   884 	int keyScanCodeNamesCount = (sizeof( keyScanCodeNames )/sizeof(TText*));
       
   885 	
       
   886 	for ( int i = 0; i < keyScanCodeNamesCount; i++ ) {
       
   887 		if ( keyScanCodes[ i ] == (TUint)aKeyScanCode ) 
       
   888 			{
       
   889 			return keyScanCodeNames[ i ];
       
   890 			}
       
   891 	}
       
   892 	
       
   893 	return NULL;
       
   894 	}
       
   895 
       
   896 /*
       
   897 -------------------------------------------------------------------------------
       
   898 
       
   899      Class: TEventUtil
       
   900 
       
   901      Method: GetModifierName
       
   902 
       
   903      Description: Gets key modifier name.
       
   904 
       
   905      Returns selected key modifier name. 
       
   906 
       
   907      Parameters: TUint aModifier: out: Key modifier.
       
   908      
       
   909      Return Values: Key modifier name.
       
   910 
       
   911      Errors/Exceptions: None.
       
   912 
       
   913      Status: Draft
       
   914     
       
   915 -------------------------------------------------------------------------------
       
   916 */
       
   917 TPtrC TEventUtil::GetModifierName( TUint aModifier )
       
   918 	{
       
   919 	DefineModifierNames( modifierNames );
       
   920 	DefineModifiers( modifiers );
       
   921 	int modifierNamesCount = (sizeof( modifierNames )/sizeof(TText*));
       
   922 	
       
   923 	for ( int i = 0; i < modifierNamesCount; i++ ) {
       
   924 		if ( modifiers[ i ] == aModifier ) 
       
   925 			{
       
   926 			return modifierNames[ i ];
       
   927 			}
       
   928 	}
       
   929 	
       
   930 	return NULL;	
       
   931 	}
       
   932 
       
   933 /*
       
   934 -------------------------------------------------------------------------------
       
   935 
       
   936      Class: TEventUtil
       
   937 
       
   938      Method: ParseKeyCode
       
   939 
       
   940      Description: Parses key code.
       
   941 
       
   942      Parses key code. 
       
   943 
       
   944      Parameters: TDesC& aKeyCodeName: in: Key code name.
       
   945      			 TUint& aKeyCode: out: Parsed key code.
       
   946      
       
   947      Return Values: KErrNone if key code was parsed successfuly, 
       
   948      				KErrNotFound in other case.
       
   949 
       
   950      Errors/Exceptions: None.
       
   951 
       
   952      Status: Draft
       
   953     
       
   954 -------------------------------------------------------------------------------
       
   955 */
       
   956 TInt TEventUtil::ParseKeyCode( const TDesC& aKeyCodeName, TUint& aKeyCode )
       
   957 	{
       
   958 	DefineKeyCodeNames( keyCodeNames );
       
   959 	DefineKeyCodes( keyCodes );
       
   960 	int keyCodeNamesCount = (sizeof( keyCodeNames )/sizeof(TText*));
       
   961 	
       
   962 	TBuf<64> keyCodeNameLowerCase( aKeyCodeName );
       
   963 	keyCodeNameLowerCase.LowerCase();
       
   964 	for ( int i = 0; i < keyCodeNamesCount; i++ ) {
       
   965 		if ( TPtrC( keyCodeNames[ i ] ).Compare( keyCodeNameLowerCase ) == 0 ) 
       
   966 			{
       
   967 			aKeyCode = keyCodes[ i ];
       
   968 			return KErrNone;
       
   969 			}
       
   970 	}
       
   971 	
       
   972 	return KErrNotFound;
       
   973 	}
       
   974 
       
   975 /*
       
   976 -------------------------------------------------------------------------------
       
   977 
       
   978      Class: TEventUtil
       
   979 
       
   980      Method: ParseKeyScanCode
       
   981 
       
   982      Description: Parses key scan code.
       
   983 
       
   984      Parses key scan code. 
       
   985 
       
   986      Parameters: TDesC& aKeyScanCodeName: in: Key scan code name.
       
   987      			 TUint& aKeyScanCode: out: Parsed key scan code.
       
   988      
       
   989      Return Values: KErrNone if key scan code was parsed successfuly, 
       
   990      				KErrNotFound in other case.
       
   991 
       
   992      Errors/Exceptions: None.
       
   993 
       
   994      Status: Draft
       
   995     
       
   996 -------------------------------------------------------------------------------
       
   997 */
       
   998 TInt TEventUtil::ParseKeyScanCode( const TDesC& aKeyScanCodeName, TInt& aKeyScanCode )
       
   999 	{
       
  1000 	DefineKeyScanCodeNames( keyScanCodeNames );
       
  1001 	DefineKeyScanCodes( keyScanCodes );
       
  1002 	int keyScanCodeNamesCount = (sizeof( keyScanCodeNames )/sizeof(TText*));
       
  1003 	
       
  1004 	TBuf<64> keyScanCodeNameLowerCase( aKeyScanCodeName );
       
  1005 	keyScanCodeNameLowerCase.LowerCase();
       
  1006 	for ( int i = 0; i < keyScanCodeNamesCount; i++ ) {
       
  1007 		if ( TPtrC( keyScanCodeNames[ i ] ).Compare( keyScanCodeNameLowerCase ) == 0 )
       
  1008 			{
       
  1009 			aKeyScanCode = keyScanCodes[ i ];
       
  1010 			return KErrNone;
       
  1011 			}
       
  1012 	}
       
  1013 	
       
  1014 	return KErrNotFound;
       
  1015 	}
       
  1016 
       
  1017 /*
       
  1018 -------------------------------------------------------------------------------
       
  1019 
       
  1020      Class: TEventUtil
       
  1021 
       
  1022      Method: ParseModifier
       
  1023 
       
  1024      Description: Parses key modifier.
       
  1025 
       
  1026      Parses key modifier. 
       
  1027 
       
  1028      Parameters: TDesC& aModifierName: in: Key modifier name.
       
  1029      			 TUint& aModifier: out: Parsed key modifier.
       
  1030      
       
  1031      Return Values: KErrNone if key modifier was parsed successfuly, 
       
  1032      				KErrNotFound in other case.
       
  1033 
       
  1034      Errors/Exceptions: None.
       
  1035 
       
  1036      Status: Draft
       
  1037     
       
  1038 -------------------------------------------------------------------------------
       
  1039 */
       
  1040 TInt TEventUtil::ParseModifier( const TDesC& aModifierName, TUint& aModifier )
       
  1041 	{
       
  1042 	DefineModifierNames( modifierNames );
       
  1043 	DefineModifiers( modifiers );
       
  1044 	int modifierNamesCount = (sizeof( modifierNames )/sizeof(TText*));
       
  1045 	
       
  1046 	TBuf<64> modifierNameLowerCase( aModifierName );
       
  1047 	modifierNameLowerCase.LowerCase();
       
  1048 	for ( int i = 0; i < modifierNamesCount; i++ ) {
       
  1049 		if ( TPtrC( modifierNames[ i ] ).Compare( modifierNameLowerCase ) == 0 )
       
  1050 			{
       
  1051 			aModifier = modifiers[ i ];
       
  1052 			return KErrNone;
       
  1053 			}
       
  1054 	}
       
  1055 	
       
  1056 	return KErrNotFound;	
       
  1057 	}
       
  1058 
       
  1059 /*
       
  1060 -------------------------------------------------------------------------------
       
  1061 
       
  1062      Class: CAknUiEnvProxy
       
  1063 
       
  1064      Method: ParsePointerEventType
       
  1065 
       
  1066      Description: Parses pointer event type.
       
  1067 
       
  1068      Parses key modifier.
       
  1069 
       
  1070      Parameters: const TDesC& aPointerEventTypeName: in: Pointer event type.
       
  1071      			 TUint& aModifier: out: Parsed pointer event type.
       
  1072      
       
  1073      Return Values: KErrNone if no error occures during parsing.
       
  1074 
       
  1075      Errors/Exceptions: None.
       
  1076 
       
  1077      Status: Draft
       
  1078     
       
  1079 -------------------------------------------------------------------------------
       
  1080 */
       
  1081 TInt TEventUtil::ParsePointerEventType( const TDesC& aPointerEventTypeName, TUint& aPointerEventType )
       
  1082 	{
       
  1083 	DefinePointerEventTypeNames( pointerEventTypeNames );
       
  1084 	DefinePointerEventTypes( pointerEventTypes );
       
  1085 	int pointerEventTypeNamesCount = (sizeof( pointerEventTypeNames )/sizeof(TText*));
       
  1086 	
       
  1087 	TBuf<64> pointerEventTypeNamesLowerCase( aPointerEventTypeName );
       
  1088 	pointerEventTypeNamesLowerCase.LowerCase();
       
  1089 	for ( int i = 0; i < pointerEventTypeNamesCount; i++ ) {
       
  1090 		if ( TPtrC( pointerEventTypeNames[ i ] ).Compare( pointerEventTypeNamesLowerCase ) == 0 )
       
  1091 			{
       
  1092 			aPointerEventType = pointerEventTypes[ i ];
       
  1093 			return KErrNone;
       
  1094 			}
       
  1095 	}
       
  1096 	
       
  1097 	return KErrNotFound;	
       
  1098 	}
       
  1099 
       
  1100 // End of File