os/boardsupport/haitest/bspsvs/suite/bsp/keypad/src/T_KeypadDriverData.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2005-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:
    15 *
    16 */
    17 
    18 #include "T_KeypadDriverData.h"
    19 
    20 _LIT(KEnumNull,						" ");
    21 _LIT(KGetScanCodes,					"GetScanCodes");
    22 _LIT(KGetModifiers,					"GetModifiers");
    23 _LIT(KTestAllKeys,					"TestAllKeys");
    24 _LIT(KTestOneModifierOneOtherKey,	"TestOneModifierOneOtherKey");
    25 _LIT(KTestTwoKeys,					"TestTwoKeys");
    26 _LIT(KTestMultipleKeys,				"TestMultipleKeys");
    27 _LIT(KVerifyKeypadState,			"VerifyKeypadState");
    28 _LIT(KPromptUser,					"PromptUser");
    29 _LIT(KSet,							"set%d");
    30 _LIT(KScanCodeString,				"scancode_string%d");
    31 _LIT(KScanCode,						"scancode%d");
    32 _LIT(KModifierString,				"modifier_string%d");
    33 _LIT(KModifier,						"modifier%d");
    34 _LIT(KTestCoverage,					"test_coverage");
    35 _LIT(KFailTest,						"fail_test");
    36 _LIT(KPassKeyStr,					"pass_key_str");
    37 _LIT(KPassKey,						"pass_key");
    38 _LIT(KExpectedState,				"expected_state");
    39 _LIT(KTimeOut,						"timeout");
    40 _LIT(KUserPrompt,					"user_prompt");
    41 _LIT(KConsoleName,					"Console_Window");
    42 _LIT(KMaximized,					"+M");
    43 _LIT(KRawEventMode,					"+R");
    44 _LIT(KRawEventModeOff,				"-R");
    45 
    46 _LIT(KLogMissingParameter,			"Missing parameter '%S'");
    47 /*@}*/
    48 
    49 // Scancodes
    50 _LIT(KStdKeyNumber0,				"'0'");
    51 _LIT(KStdKeyNumber1,				"'1'");
    52 _LIT(KStdKeyNumber2,				"'2'");
    53 _LIT(KStdKeyNumber3,				"'3'");
    54 _LIT(KStdKeyNumber4,				"'4'");
    55 _LIT(KStdKeyNumber5,				"'5'");
    56 _LIT(KStdKeyNumber6,				"'6'");
    57 _LIT(KStdKeyNumber7,				"'7'");
    58 _LIT(KStdKeyNumber8,				"'8'");
    59 _LIT(KStdKeyNumber9,				"'9'");
    60 _LIT(KStdKeyLetterA,				"'A'");
    61 _LIT(KStdKeyLetterB,				"'B'");
    62 _LIT(KStdKeyLetterC,				"'C'");
    63 _LIT(KStdKeyLetterD,				"'D'");
    64 _LIT(KStdKeyLetterE,				"'E'");
    65 _LIT(KStdKeyLetterF,				"'F'");
    66 _LIT(KStdKeyLetterG,				"'G'");
    67 _LIT(KStdKeyLetterH,				"'H'");
    68 _LIT(KStdKeyLetterI,				"'I'");
    69 _LIT(KStdKeyLetterJ,				"'J'");
    70 _LIT(KStdKeyLetterK,				"'K'");
    71 _LIT(KStdKeyLetterL,				"'L'");
    72 _LIT(KStdKeyLetterM,				"'M'");
    73 _LIT(KStdKeyLetterN,				"'N'");
    74 _LIT(KStdKeyLetterO,				"'O'");
    75 _LIT(KStdKeyLetterP,				"'P'");
    76 _LIT(KStdKeyLetterQ,				"'Q'");
    77 _LIT(KStdKeyLetterR,				"'R'");
    78 _LIT(KStdKeyLetterS,				"'S'");
    79 _LIT(KStdKeyLetterT,				"'T'");
    80 _LIT(KStdKeyLetterU,				"'U'");
    81 _LIT(KStdKeyLetterV,				"'V'");
    82 _LIT(KStdKeyLetterW,				"'W'");
    83 _LIT(KStdKeyLetterX,				"'X'");
    84 _LIT(KStdKeyLetterY,				"'Y'");
    85 _LIT(KStdKeyLetterZ,				"'Z'");
    86 _LIT(KStdKeyAsterisk,				"'*'");
    87 _LIT(KStdKeyNull,					"EStdKeyNull");
    88 _LIT(KStdKeyBackspace,				"EStdKeyBackspace");
    89 _LIT(KStdKeyTab,					"EStdKeyTab");
    90 _LIT(KStdKeyEnter,					"EStdKeyEnter");
    91 _LIT(KStdKeyEscape,					"EStdKeyEscape");
    92 _LIT(KStdKeySpace,					"EStdKeySpace");
    93 _LIT(KStdKeyPrintScreen,			"EStdKeyPrintScreen");
    94 _LIT(KStdKeyPause,					"EStdKeyPause");
    95 _LIT(KStdKeyHome,					"EStdKeyHome");
    96 _LIT(KStdKeyEnd,					"EStdKeyEnd");
    97 _LIT(KStdKeyPageUp,					"EStdKeyPageUp");
    98 _LIT(KStdKeyPageDown,				"EStdKeyPageDown");
    99 _LIT(KStdKeyInsert,					"EStdKeyInsert");
   100 _LIT(KStdKeyDelete,					"EStdKeyDelete");
   101 _LIT(KStdKeyLeftArrow,				"EStdKeyLeftArrow");
   102 _LIT(KStdKeyRightArrow,				"EStdKeyRightArrow");
   103 _LIT(KStdKeyUpArrow,				"EStdKeyUpArrow");
   104 _LIT(KStdKeyDownArrow,				"EStdKeyDownArrow");
   105 _LIT(KStdKeyLeftShift,				"EStdKeyLeftShift");
   106 _LIT(KStdKeyRightShift,				"EStdKeyRightShift");
   107 _LIT(KStdKeyLeftAlt,				"EStdKeyLeftAlt");
   108 _LIT(KStdKeyRightAlt,				"EStdKeyRightAlt");
   109 _LIT(KStdKeyLeftCtrl,				"EStdKeyLeftCtrl");
   110 _LIT(KStdKeyRightCtrl,				"EStdKeyRightCtrl");
   111 _LIT(KStdKeyLeftFunc,				"EStdKeyLeftFunc");
   112 _LIT(KStdKeyRightFunc,				"EStdKeyRightFunc");
   113 _LIT(KStdKeyCapsLock,				"EStdKeyCapsLock");
   114 _LIT(KStdKeyNumLock,				"EStdKeyNumLock");
   115 _LIT(KStdKeyScrollLock,				"EStdKeyScrollLock");
   116 _LIT(KStdKeyF1,						"EStdKeyF1");
   117 _LIT(KStdKeyF2,						"EStdKeyF2");
   118 _LIT(KStdKeyF3,						"EStdKeyF3");
   119 _LIT(KStdKeyF4,						"EStdKeyF4");
   120 _LIT(KStdKeyF5,						"EStdKeyF5");
   121 _LIT(KStdKeyF6,						"EStdKeyF6");
   122 _LIT(KStdKeyF7,						"EStdKeyF7");
   123 _LIT(KStdKeyF8,						"EStdKeyF8");
   124 _LIT(KStdKeyF9,						"EStdKeyF9");
   125 _LIT(KStdKeyF10,					"EStdKeyF10");
   126 _LIT(KStdKeyF11,					"EStdKeyF11");
   127 _LIT(KStdKeyF12,					"EStdKeyF12");
   128 _LIT(KStdKeyF13,					"EStdKeyF13");
   129 _LIT(KStdKeyF14,					"EStdKeyF14");
   130 _LIT(KStdKeyF15,					"EStdKeyF15");
   131 _LIT(KStdKeyF16,					"EStdKeyF16");
   132 _LIT(KStdKeyF17,					"EStdKeyF17");
   133 _LIT(KStdKeyF18,					"EStdKeyF18");
   134 _LIT(KStdKeyF19,					"EStdKeyF19");
   135 _LIT(KStdKeyF20,					"EStdKeyF20");
   136 _LIT(KStdKeyF21,					"EStdKeyF21");
   137 _LIT(KStdKeyF22,					"EStdKeyF22");
   138 _LIT(KStdKeyF23,					"EStdKeyF23");
   139 _LIT(KStdKeyF24,					"EStdKeyF24");
   140 _LIT(KStdKeyXXX,					"EStdKeyXXX");
   141 _LIT(KStdKeyComma,					"EStdKeyComma");
   142 _LIT(KStdKeyFullStop,				"EStdKeyFullStop");
   143 _LIT(KStdKeyForwardSlash,			"EStdKeyForwardSlash");
   144 _LIT(KStdKeyBackSlash,				"EStdKeyBackSlash");
   145 _LIT(KStdKeySemiColon,				"EStdKeySemiColon");
   146 _LIT(KStdKeySingleQuote,			"EStdKeySingleQuote");
   147 _LIT(KStdKeyHash,					"EStdKeyHash");
   148 _LIT(KStdKeySquareBracketLeft,		"EStdKeySquareBracketLeft");
   149 _LIT(KStdKeySquareBracketRight,		"EStdKeySquareBracketRight");
   150 _LIT(KStdKeyMinus,					"EStdKeyMinus");
   151 _LIT(KStdKeyEquals,					"EStdKeyEquals");
   152 _LIT(KStdKeyNkpForwardSlash,		"EStdKeyNkpForwardSlash");
   153 _LIT(KStdKeyNkpAsterisk,			"EStdKeyNkpAsterisk");
   154 _LIT(KStdKeyNkpMinus,				"EStdKeyNkpMinus");
   155 _LIT(KStdKeyNkpPlus,				"EStdKeyNkpPlus");
   156 _LIT(KStdKeyNkpEnter,				"EStdKeyNkpEnter");
   157 _LIT(KStdKeyNkp1,					"EStdKeyNkp1");
   158 _LIT(KStdKeyNkp2,					"EStdKeyNkp2");
   159 _LIT(KStdKeyNkp3,					"EStdKeyNkp3");
   160 _LIT(KStdKeyNkp4,					"EStdKeyNkp4");
   161 _LIT(KStdKeyNkp5,					"EStdKeyNkp5");
   162 _LIT(KStdKeyNkp6,					"EStdKeyNkp6");
   163 _LIT(KStdKeyNkp7,					"EStdKeyNkp7");
   164 _LIT(KStdKeyNkp8,					"EStdKeyNkp8");
   165 _LIT(KStdKeyNkp9,					"EStdKeyNkp9");
   166 _LIT(KStdKeyNkp0,					"EStdKeyNkp0");
   167 _LIT(KStdKeyNkpFullStop,			"EStdKeyNkpFullStop");
   168 _LIT(KStdKeyMenu,					"EStdKeyMenu");
   169 _LIT(KStdKeyBacklightOn,			"EStdKeyBacklightOn");
   170 _LIT(KStdKeyBacklightOff,			"EStdKeyBacklightOff");
   171 _LIT(KStdKeyBacklightToggle,		"EStdKeyBacklightToggle");
   172 _LIT(KStdKeyIncContrast,			"EStdKeyIncContrast");
   173 _LIT(KStdKeyDecContrast,			"EStdKeyDecContrast");
   174 _LIT(KStdKeySliderDown,				"EStdKeySliderDown");
   175 _LIT(KStdKeySliderUp,				"EStdKeySliderUp");
   176 _LIT(KStdKeyDictaphonePlay,			"EStdKeyDictaphonePlay");
   177 _LIT(KStdKeyDictaphoneStop,			"EStdKeyDictaphoneStop");
   178 _LIT(KStdKeyDictaphoneRecord,		"EStdKeyDictaphoneRecord");
   179 _LIT(KStdKeyHelp,					"EStdKeyHelp");
   180 _LIT(KStdKeyOff,					"EStdKeyOff");
   181 _LIT(KStdKeyDial,					"EStdKeyDial");
   182 _LIT(KStdKeyIncVolume,				"EStdKeyIncVolume");
   183 _LIT(KStdKeyDecVolume,				"EStdKeyDecVolume");
   184 _LIT(KStdKeyDevice0,				"EStdKeyDevice0");
   185 _LIT(KStdKeyDevice1,				"EStdKeyDevice1");
   186 _LIT(KStdKeyDevice2,				"EStdKeyDevice2");
   187 _LIT(KStdKeyDevice3,				"EStdKeyDevice3");
   188 _LIT(KStdKeyDevice4,				"EStdKeyDevice4");
   189 _LIT(KStdKeyDevice5,				"EStdKeyDevice5");
   190 _LIT(KStdKeyDevice6,				"EStdKeyDevice6");
   191 _LIT(KStdKeyDevice7,				"EStdKeyDevice7");
   192 _LIT(KStdKeyDevice8,				"EStdKeyDevice8");
   193 _LIT(KStdKeyDevice9,				"EStdKeyDevice9");
   194 _LIT(KStdKeyDeviceA,				"EStdKeyDeviceA");
   195 _LIT(KStdKeyDeviceB,				"EStdKeyDeviceB");
   196 _LIT(KStdKeyDeviceC,				"EStdKeyDeviceC");
   197 _LIT(KStdKeyDeviceD,				"EStdKeyDeviceD");
   198 _LIT(KStdKeyDeviceE,				"EStdKeyDeviceE");
   199 _LIT(KStdKeyDeviceF,				"EStdKeyDeviceF");
   200 _LIT(KStdKeyApplication0,			"EStdKeyApplication0");
   201 _LIT(KStdKeyApplication1,			"EStdKeyApplication1");
   202 _LIT(KStdKeyApplication2,			"EStdKeyApplication2");
   203 _LIT(KStdKeyApplication3,			"EStdKeyApplication3");
   204 _LIT(KStdKeyApplication4,			"EStdKeyApplication4");
   205 _LIT(KStdKeyApplication5,			"EStdKeyApplication5");
   206 _LIT(KStdKeyApplication6,			"EStdKeyApplication6");
   207 _LIT(KStdKeyApplication7,			"EStdKeyApplication7");
   208 _LIT(KStdKeyApplication8,			"EStdKeyApplication8");
   209 _LIT(KStdKeyApplication9,			"EStdKeyApplication9");
   210 _LIT(KStdKeyApplicationA,			"EStdKeyApplicationA");
   211 _LIT(KStdKeyApplicationB,			"EStdKeyApplicationB");
   212 _LIT(KStdKeyApplicationC,			"EStdKeyApplicationC");
   213 _LIT(KStdKeyApplicationD,			"EStdKeyApplicationD");
   214 _LIT(KStdKeyApplicationE,			"EStdKeyApplicationE");
   215 _LIT(KStdKeyApplicationF,			"EStdKeyApplicationF");
   216 _LIT(KStdKeyYes,					"EStdKeyYes");
   217 _LIT(KStdKeyNo,						"EStdKeyNo");
   218 _LIT(KStdKeyIncBrightness,			"EStdKeyIncBrightness");
   219 _LIT(KStdKeyDecBrightness,			"EStdKeyDecBrightness");
   220 _LIT(KStdKeyKeyboardExtend,			"EStdKeyKeyboardExtend");
   221 _LIT(KStdKeyDevice10,				"EStdKeyDevice10");
   222 _LIT(KStdKeyDevice11,				"EStdKeyDevice11");
   223 _LIT(KStdKeyDevice12,				"EStdKeyDevice12");
   224 _LIT(KStdKeyDevice13,				"EStdKeyDevice13");
   225 _LIT(KStdKeyDevice14,				"EStdKeyDevice14");
   226 _LIT(KStdKeyDevice15,				"EStdKeyDevice15");
   227 _LIT(KStdKeyDevice16,				"EStdKeyDevice16");
   228 _LIT(KStdKeyDevice17,				"EStdKeyDevice17");
   229 _LIT(KStdKeyDevice18,				"EStdKeyDevice18");
   230 _LIT(KStdKeyDevice19,				"EStdKeyDevice19");
   231 _LIT(KStdKeyDevice1A,				"EStdKeyDevice1A");
   232 _LIT(KStdKeyDevice1B,				"EStdKeyDevice1B");
   233 _LIT(KStdKeyDevice1C,				"EStdKeyDevice1C");
   234 _LIT(KStdKeyDevice1D,				"EStdKeyDevice1D");
   235 _LIT(KStdKeyDevice1E,				"EStdKeyDevice1E");
   236 _LIT(KStdKeyDevice1F,				"EStdKeyDevice1F");
   237 _LIT(KStdKeyApplication10,			"EStdKeyApplication10");
   238 _LIT(KStdKeyApplication11,			"EStdKeyApplication11");
   239 _LIT(KStdKeyApplication12,			"EStdKeyApplication12");
   240 _LIT(KStdKeyApplication13,			"EStdKeyApplication13");
   241 _LIT(KStdKeyApplication14,			"EStdKeyApplication14");
   242 _LIT(KStdKeyApplication15,			"EStdKeyApplication15");
   243 _LIT(KStdKeyApplication16,			"EStdKeyApplication16");
   244 _LIT(KStdKeyApplication17,			"EStdKeyApplication17");
   245 _LIT(KStdKeyApplication18,			"EStdKeyApplication18");
   246 _LIT(KStdKeyApplication19,			"EStdKeyApplication19");
   247 _LIT(KStdKeyApplication1A,			"EStdKeyApplication1A");
   248 _LIT(KStdKeyApplication1B,			"EStdKeyApplication1B");
   249 _LIT(KStdKeyApplication1C,			"EStdKeyApplication1C");
   250 _LIT(KStdKeyApplication1D,			"EStdKeyApplication1D");
   251 _LIT(KStdKeyApplication1E,			"EStdKeyApplication1E");
   252 _LIT(KStdKeyApplication1F,			"EStdKeyApplication1F");
   253 _LIT(KStdKeyDevice20,				"EStdKeyDevice20");
   254 _LIT(KStdKeyDevice21,				"EStdKeyDevice21");
   255 _LIT(KStdKeyDevice22,				"EStdKeyDevice22");
   256 _LIT(KStdKeyDevice23,				"EStdKeyDevice23");
   257 _LIT(KStdKeyDevice24,				"EStdKeyDevice24");
   258 _LIT(KStdKeyDevice25,				"EStdKeyDevice25");
   259 _LIT(KStdKeyDevice26,				"EStdKeyDevice26");
   260 _LIT(KStdKeyDevice27,				"EStdKeyDevice27");
   261 _LIT(KStdKeyApplication20,			"EStdKeyApplication20");
   262 _LIT(KStdKeyApplication21,			"EStdKeyApplication21");
   263 _LIT(KStdKeyApplication22,			"EStdKeyApplication22");
   264 _LIT(KStdKeyApplication23,			"EStdKeyApplication23");
   265 _LIT(KStdKeyApplication24,			"EStdKeyApplication24");
   266 _LIT(KStdKeyApplication25,			"EStdKeyApplication25");
   267 _LIT(KStdKeyApplication26,			"EStdKeyApplication26");
   268 _LIT(KStdKeyApplication27,			"EStdKeyApplication27");
   269 const CDataWrapperBase::TEnumEntryTable	CT_KeypadDriverData::iEnumTableScanCodes[] =
   270 	{
   271 //	Scancode as a descriptor		Scancode
   272 	KStdKeyNumber0,					(TStdScanCode) '0',
   273 	KStdKeyNumber1,					(TStdScanCode) '1',
   274 	KStdKeyNumber2,					(TStdScanCode) '2',
   275 	KStdKeyNumber3,					(TStdScanCode) '3',
   276 	KStdKeyNumber4,					(TStdScanCode) '4',
   277 	KStdKeyNumber5,					(TStdScanCode) '5',
   278 	KStdKeyNumber6,					(TStdScanCode) '6',
   279 	KStdKeyNumber7,					(TStdScanCode) '7',
   280 	KStdKeyNumber8,					(TStdScanCode) '8',
   281 	KStdKeyNumber9,					(TStdScanCode) '9',
   282 	KStdKeyLetterA,					(TStdScanCode) 'A',
   283 	KStdKeyLetterB,					(TStdScanCode) 'B',
   284 	KStdKeyLetterC,					(TStdScanCode) 'C',
   285 	KStdKeyLetterD,					(TStdScanCode) 'D',
   286 	KStdKeyLetterE,					(TStdScanCode) 'E',
   287 	KStdKeyLetterF,					(TStdScanCode) 'F',
   288 	KStdKeyLetterG,					(TStdScanCode) 'G',
   289 	KStdKeyLetterH,					(TStdScanCode) 'H',
   290 	KStdKeyLetterI,					(TStdScanCode) 'I',
   291 	KStdKeyLetterJ,					(TStdScanCode) 'J',
   292 	KStdKeyLetterK,					(TStdScanCode) 'K',
   293 	KStdKeyLetterL,					(TStdScanCode) 'L',
   294 	KStdKeyLetterM,					(TStdScanCode) 'M',
   295 	KStdKeyLetterN,					(TStdScanCode) 'N',
   296 	KStdKeyLetterO,					(TStdScanCode) 'O',
   297 	KStdKeyLetterP,					(TStdScanCode) 'P',
   298 	KStdKeyLetterQ,					(TStdScanCode) 'Q',
   299 	KStdKeyLetterR,					(TStdScanCode) 'R',
   300 	KStdKeyLetterS,					(TStdScanCode) 'S',
   301 	KStdKeyLetterT,					(TStdScanCode) 'T',
   302 	KStdKeyLetterU,					(TStdScanCode) 'U',
   303 	KStdKeyLetterV,					(TStdScanCode) 'V',
   304 	KStdKeyLetterW,					(TStdScanCode) 'W',
   305 	KStdKeyLetterX,					(TStdScanCode) 'X',
   306 	KStdKeyLetterY,					(TStdScanCode) 'Y',
   307 	KStdKeyLetterZ,					(TStdScanCode) 'Z',
   308 	KStdKeyAsterisk,				(TStdScanCode) '*',
   309 	KStdKeyNull,					EStdKeyNull,
   310 	KStdKeyBackspace,				EStdKeyBackspace,
   311 	KStdKeyTab,						EStdKeyTab,
   312 	KStdKeyEnter,					EStdKeyEnter,
   313 	KStdKeyEscape,					EStdKeyEscape,
   314 	KStdKeySpace,					EStdKeySpace,
   315 	KStdKeyPrintScreen,				EStdKeyPrintScreen,
   316 	KStdKeyPause,					EStdKeyPause,
   317 	KStdKeyHome,					EStdKeyHome,
   318 	KStdKeyEnd,						EStdKeyEnd,
   319 	KStdKeyPageUp,					EStdKeyPageUp,
   320 	KStdKeyPageDown,				EStdKeyPageDown,
   321 	KStdKeyInsert,					EStdKeyInsert,
   322 	KStdKeyDelete,					EStdKeyDelete,
   323 	KStdKeyLeftArrow,				EStdKeyLeftArrow,
   324 	KStdKeyRightArrow,				EStdKeyRightArrow,
   325 	KStdKeyUpArrow,					EStdKeyUpArrow,
   326 	KStdKeyDownArrow,				EStdKeyDownArrow,
   327 	KStdKeyLeftShift,				EStdKeyLeftShift,
   328 	KStdKeyRightShift,				EStdKeyRightShift,
   329 	KStdKeyLeftAlt,					EStdKeyLeftAlt,
   330 	KStdKeyRightAlt,				EStdKeyRightAlt,
   331 	KStdKeyLeftCtrl,				EStdKeyLeftCtrl,
   332 	KStdKeyRightCtrl,				EStdKeyRightCtrl,
   333 	KStdKeyLeftFunc,				EStdKeyLeftFunc,
   334 	KStdKeyRightFunc,				EStdKeyRightFunc,
   335 	KStdKeyCapsLock,				EStdKeyCapsLock,
   336 	KStdKeyNumLock,					EStdKeyNumLock,
   337 	KStdKeyScrollLock,				EStdKeyScrollLock,
   338 	KStdKeyF1,						EStdKeyF1,
   339 	KStdKeyF2,						EStdKeyF2,
   340 	KStdKeyF3,						EStdKeyF3,
   341 	KStdKeyF4,						EStdKeyF4,
   342 	KStdKeyF5,						EStdKeyF5,
   343 	KStdKeyF6,						EStdKeyF6,
   344 	KStdKeyF7,						EStdKeyF7,
   345 	KStdKeyF8,						EStdKeyF8,
   346 	KStdKeyF9,						EStdKeyF9,
   347 	KStdKeyF10,						EStdKeyF10,
   348 	KStdKeyF11,						EStdKeyF11,
   349 	KStdKeyF12,						EStdKeyF12,
   350 	KStdKeyF13,						EStdKeyF13,
   351 	KStdKeyF14,						EStdKeyF14,
   352 	KStdKeyF15,						EStdKeyF15,
   353 	KStdKeyF16,						EStdKeyF16,
   354 	KStdKeyF17,						EStdKeyF17,
   355 	KStdKeyF18,						EStdKeyF18,
   356 	KStdKeyF19,						EStdKeyF19,
   357 	KStdKeyF20,						EStdKeyF20,
   358 	KStdKeyF21,						EStdKeyF21,
   359 	KStdKeyF22,						EStdKeyF22,
   360 	KStdKeyF23,						EStdKeyF23,
   361 	KStdKeyF24,						EStdKeyF24,
   362 	KStdKeyXXX,						EStdKeyXXX,
   363 	KStdKeyComma,					EStdKeyComma,
   364 	KStdKeyFullStop,				EStdKeyFullStop,
   365 	KStdKeyForwardSlash,			EStdKeyForwardSlash,
   366 	KStdKeyBackSlash,				EStdKeyBackSlash,
   367 	KStdKeySemiColon,				EStdKeySemiColon,
   368 	KStdKeySingleQuote,				EStdKeySingleQuote,
   369 	KStdKeyHash,					EStdKeyHash,
   370 	KStdKeySquareBracketLeft,		EStdKeySquareBracketLeft,
   371 	KStdKeySquareBracketRight,		EStdKeySquareBracketRight,
   372 	KStdKeyMinus,					EStdKeyMinus,
   373 	KStdKeyEquals,					EStdKeyEquals,
   374 	KStdKeyNkpForwardSlash,			EStdKeyNkpForwardSlash,
   375 	KStdKeyNkpAsterisk,				EStdKeyNkpAsterisk,
   376 	KStdKeyNkpMinus,				EStdKeyNkpMinus,
   377 	KStdKeyNkpPlus,					EStdKeyNkpPlus,
   378 	KStdKeyNkpEnter,				EStdKeyNkpEnter,
   379 	KStdKeyNkp1,					EStdKeyNkp1,
   380 	KStdKeyNkp2,					EStdKeyNkp2,
   381 	KStdKeyNkp3,					EStdKeyNkp3,
   382 	KStdKeyNkp4,					EStdKeyNkp4,
   383 	KStdKeyNkp5,					EStdKeyNkp5,
   384 	KStdKeyNkp6,					EStdKeyNkp6,
   385 	KStdKeyNkp7,					EStdKeyNkp7,
   386 	KStdKeyNkp8,					EStdKeyNkp8,
   387 	KStdKeyNkp9,					EStdKeyNkp9,
   388 	KStdKeyNkp0,					EStdKeyNkp0,
   389 	KStdKeyNkpFullStop,				EStdKeyNkpFullStop,
   390 	KStdKeyMenu,					EStdKeyMenu,
   391 	KStdKeyBacklightOn,				EStdKeyBacklightOn,
   392 	KStdKeyBacklightOff,			EStdKeyBacklightOff,
   393 	KStdKeyBacklightToggle,			EStdKeyBacklightToggle,
   394 	KStdKeyIncContrast,				EStdKeyIncContrast,
   395 	KStdKeyDecContrast,				EStdKeyDecContrast,
   396 	KStdKeySliderDown,				EStdKeySliderDown,
   397 	KStdKeySliderUp,				EStdKeySliderUp,
   398 	KStdKeyDictaphonePlay,			EStdKeyDictaphonePlay,
   399 	KStdKeyDictaphoneStop,			EStdKeyDictaphoneStop,
   400 	KStdKeyDictaphoneRecord,		EStdKeyDictaphoneRecord,
   401 	KStdKeyHelp,					EStdKeyHelp,
   402 	KStdKeyOff,						EStdKeyOff,
   403 	KStdKeyDial,					EStdKeyDial,
   404 	KStdKeyIncVolume,				EStdKeyIncVolume,
   405 	KStdKeyDecVolume,				EStdKeyDecVolume,
   406 	KStdKeyDevice0,					EStdKeyDevice0,
   407 	KStdKeyDevice1,					EStdKeyDevice1,
   408 	KStdKeyDevice2,					EStdKeyDevice2,
   409 	KStdKeyDevice3,					EStdKeyDevice3,
   410 	KStdKeyDevice4,					EStdKeyDevice4,
   411 	KStdKeyDevice5,					EStdKeyDevice5,
   412 	KStdKeyDevice6,					EStdKeyDevice6,
   413 	KStdKeyDevice7,					EStdKeyDevice7,
   414 	KStdKeyDevice8,					EStdKeyDevice8,
   415 	KStdKeyDevice9,					EStdKeyDevice9,
   416 	KStdKeyDeviceA,					EStdKeyDeviceA,
   417 	KStdKeyDeviceB,					EStdKeyDeviceB,
   418 	KStdKeyDeviceC,					EStdKeyDeviceC,
   419 	KStdKeyDeviceD,					EStdKeyDeviceD,
   420 	KStdKeyDeviceE,					EStdKeyDeviceE,
   421 	KStdKeyDeviceF,					EStdKeyDeviceF,
   422 	KStdKeyApplication0,			EStdKeyApplication0,
   423 	KStdKeyApplication1,			EStdKeyApplication1,
   424 	KStdKeyApplication2,			EStdKeyApplication2,
   425 	KStdKeyApplication3,			EStdKeyApplication3,
   426 	KStdKeyApplication4,			EStdKeyApplication4,
   427 	KStdKeyApplication5,			EStdKeyApplication5,
   428 	KStdKeyApplication6,			EStdKeyApplication6,
   429 	KStdKeyApplication7,			EStdKeyApplication7,
   430 	KStdKeyApplication8,			EStdKeyApplication8,
   431 	KStdKeyApplication9,			EStdKeyApplication9,
   432 	KStdKeyApplicationA,			EStdKeyApplicationA,
   433 	KStdKeyApplicationB,			EStdKeyApplicationB,
   434 	KStdKeyApplicationC,			EStdKeyApplicationC,
   435 	KStdKeyApplicationD,			EStdKeyApplicationD,
   436 	KStdKeyApplicationE,			EStdKeyApplicationE,
   437 	KStdKeyApplicationF,			EStdKeyApplicationF,
   438 	KStdKeyYes,						EStdKeyYes,
   439 	KStdKeyNo,						EStdKeyNo,
   440 	KStdKeyIncBrightness,			EStdKeyIncBrightness,
   441 	KStdKeyDecBrightness,			EStdKeyDecBrightness,
   442 	KStdKeyKeyboardExtend,			EStdKeyKeyboardExtend,
   443 	KStdKeyDevice10,				EStdKeyDevice10,
   444 	KStdKeyDevice11,				EStdKeyDevice11,
   445 	KStdKeyDevice12,				EStdKeyDevice12,
   446 	KStdKeyDevice13,				EStdKeyDevice13,
   447 	KStdKeyDevice14,				EStdKeyDevice14,
   448 	KStdKeyDevice15,				EStdKeyDevice15,
   449 	KStdKeyDevice16,				EStdKeyDevice16,
   450 	KStdKeyDevice17,				EStdKeyDevice17,
   451 	KStdKeyDevice18,				EStdKeyDevice18,
   452 	KStdKeyDevice19,				EStdKeyDevice19,
   453 	KStdKeyDevice1A,				EStdKeyDevice1A,
   454 	KStdKeyDevice1B,				EStdKeyDevice1B,
   455 	KStdKeyDevice1C,				EStdKeyDevice1C,
   456 	KStdKeyDevice1D,				EStdKeyDevice1D,
   457 	KStdKeyDevice1E,				EStdKeyDevice1E,
   458 	KStdKeyDevice1F,				EStdKeyDevice1F,
   459 	KStdKeyApplication10,			EStdKeyApplication10,
   460 	KStdKeyApplication11,			EStdKeyApplication11,
   461 	KStdKeyApplication12,			EStdKeyApplication12,
   462 	KStdKeyApplication13,			EStdKeyApplication13,
   463 	KStdKeyApplication14,			EStdKeyApplication14,
   464 	KStdKeyApplication15,			EStdKeyApplication15,
   465 	KStdKeyApplication16,			EStdKeyApplication16,
   466 	KStdKeyApplication17,			EStdKeyApplication17,
   467 	KStdKeyApplication18,			EStdKeyApplication18,
   468 	KStdKeyApplication19,			EStdKeyApplication19,
   469 	KStdKeyApplication1A,			EStdKeyApplication1A,
   470 	KStdKeyApplication1B,			EStdKeyApplication1B,
   471 	KStdKeyApplication1C,			EStdKeyApplication1C,
   472 	KStdKeyApplication1D,			EStdKeyApplication1D,
   473 	KStdKeyApplication1E,			EStdKeyApplication1E,
   474 	KStdKeyApplication1F,			EStdKeyApplication1F,
   475 	KStdKeyDevice20,				EStdKeyDevice20,
   476 	KStdKeyDevice21,				EStdKeyDevice21,
   477 	KStdKeyDevice22,				EStdKeyDevice22,
   478 	KStdKeyDevice23,				EStdKeyDevice23,
   479 	KStdKeyDevice24,				EStdKeyDevice24,
   480 	KStdKeyDevice25,				EStdKeyDevice25,
   481 	KStdKeyDevice26,				EStdKeyDevice26,
   482 	KStdKeyDevice27,				EStdKeyDevice27,
   483 	KStdKeyApplication20,			EStdKeyApplication20,
   484 	KStdKeyApplication21,			EStdKeyApplication21,
   485 	KStdKeyApplication22,			EStdKeyApplication22,
   486 	KStdKeyApplication23,			EStdKeyApplication23,
   487 	KStdKeyApplication24,			EStdKeyApplication24,
   488 	KStdKeyApplication25,			EStdKeyApplication25,
   489 	KStdKeyApplication26,			EStdKeyApplication26,
   490 	KStdKeyApplication27,			EStdKeyApplication27,
   491 	KEnumNull,						(TStdScanCode) -1
   492 	};
   493 
   494 _LIT(KEnumCoverageVeryLow,			"VeryLow");
   495 _LIT(KEnumCoverageLow,				"Low");
   496 _LIT(KEnumCoverageMedium,			"Medium");
   497 _LIT(KEnumCoverageFull,				"Full");
   498 const CDataWrapperBase::TEnumEntryTable	CT_KeypadDriverData::iEnumTableCoverage[] =
   499 	{
   500 	KEnumCoverageVeryLow,			8,
   501 	KEnumCoverageLow,				4,
   502 	KEnumCoverageMedium,			2,
   503 	KEnumCoverageFull,				1,
   504 	KEnumNull,						-1
   505 	};
   506 
   507 _LIT(KEnumKeyboardState,					"EKeyboardState");
   508 _LIT(KEnumKeyboard,							"EKeyboard");
   509 _LIT(KEnumKeyboardDeviceKeys,				"EKeyboardDeviceKeys");
   510 _LIT(KEnumKeyboardAppKeys,					"EKeyboardAppKeys");
   511 _LIT(KEnumKeyboardClick,					"EKeyboardClick");
   512 _LIT(KEnumKeyboardClickVolumeMax,			"EKeyboardClickVolumeMax");
   513 _LIT(KEnumKeyboardClickState,				"EKeyboardClickState");
   514 _LIT(KEnumKeyboardClickVolume,				"EKeyboardClickVolume");
   515 const CT_HALData::THalTableLookup	CT_KeypadDriverData::iTableLookup[] =
   516 	{
   517 //	Enum as a descriptor			Enum								Prepare input	Prepare				Validation of		Store data returned after a		Flag indicating
   518 //																		value prior to	parameters			value returned		successful HAL::Get or			if validation
   519 //																		HAL::Set call	prior to 			after a successful	HAL::Set call					is mandatory
   520 //																						HAL::Get call		HAL::Get call
   521 	KEnumKeyboardState,				HALData::EKeyboardState,			SetPrepareInt,	GetPrepareNothing,	GetValidationInt,	SetKeyboardState,				ETrue,
   522 	KEnumKeyboard,					HALData::EKeyboard,					SetPrepareInt,	GetPrepareNothing,	GetValidationInt,	SetKeyboard,					ETrue,
   523 	KEnumKeyboardDeviceKeys,		HALData::EKeyboardDeviceKeys,		SetPrepareInt,	GetPrepareNothing,	GetValidationInt,	SetKeyboardDeviceKeys,			ETrue,
   524 	KEnumKeyboardAppKeys,			HALData::EKeyboardAppKeys,			SetPrepareInt,	GetPrepareNothing,	GetValidationInt,	SetKeyboardAppKeys,				ETrue,
   525 	KEnumKeyboardClick,				HALData::EKeyboardClick,			SetPrepareInt,	GetPrepareNothing,	GetValidationInt,	SetKeyboardClick,				ETrue,
   526 	KEnumKeyboardClickVolumeMax,	HALData::EKeyboardClickVolumeMax,	SetPrepareInt,	GetPrepareNothing,	GetValidationInt,	SetKeyboardClickVolumeMax,		ETrue,
   527 	KEnumKeyboardClickState,		HALData::EKeyboardClickState,		SetPrepareInt,	GetPrepareNothing,	GetValidationInt,	SetKeyboardClickState,			ETrue,
   528 	KEnumKeyboardClickVolume,		HALData::EKeyboardClickVolume,		SetPrepareInt,	GetPrepareNothing,	GetValidationInt,	SetKeyboardClickVolume,			ETrue,
   529 	KEnumNull,						(HALData::TAttribute)0,				NULL,			NULL,				NULL,				NULL,							NULL
   530 	};
   531 
   532 //////////////////////////////////////////////////////////////////////
   533 // Construction/Destruction
   534 //////////////////////////////////////////////////////////////////////
   535 
   536 CT_KeypadDriverData* CT_KeypadDriverData::NewL()
   537 	{
   538 	CT_KeypadDriverData*	ret=new (ELeave) CT_KeypadDriverData();
   539 	CleanupStack::PushL(ret);
   540 	ret->ConstructL();
   541 	CleanupStack::Pop(ret);
   542 	return ret;
   543 	}
   544 
   545 
   546 CT_KeypadDriverData::CT_KeypadDriverData()
   547 :	CT_HALData(iTableLookup)
   548 ,	iKeyboardState(-1)
   549 ,	iKeyboard(-1)
   550 ,	iKeyboardDeviceKeys(-1)
   551 ,	iKeyboardAppKeys(-1)
   552 ,	iKeyboardClick(-1)
   553 ,	iKeyboardClickVolumeMax(-1)
   554 ,	iKeyboardClickState(-1)
   555 ,	iKeyboardClickVolume(-1)
   556 ,	iActiveKey(NULL)
   557 ,	iActiveCombination(NULL)
   558 ,	iActiveKeypadState(NULL)
   559 ,	iActivePrompt(NULL)
   560 ,	iExpectedState(0)
   561 ,	iKeyCount(0)
   562 ,	iCombinationCount(0)
   563 ,	iCombinationKeyCount(0)
   564 ,	iFailTest(EFalse)
   565 ,	iPassKey(0)
   566 	{
   567 	}
   568 
   569 void CT_KeypadDriverData::ConstructL()
   570 /**
   571  * Second phase construction
   572  *
   573  * @internalComponent
   574  *
   575  * @return	N/A
   576  *
   577  * @pre		None
   578  * @post	None
   579  *
   580  * @leave	system wide error
   581  */
   582 	{
   583 	iActiveKey 				= CActiveCallback::NewL(*this);
   584 	iActiveCombination		= CActiveCallback::NewL(*this);
   585 	iActiveKeypadState		= CActiveCallbackBase::NewL(*this);
   586 	iActivePrompt			= CActiveCallback::NewL(*this);
   587 
   588 	User::LeaveIfError(iConsole.Init(KConsoleName,TSize(KConsFullScreen,KConsFullScreen)));
   589 	User::LeaveIfError(iConsole.Control(KMaximized));
   590 	User::LeaveIfError(iConsole.Control(KRawEventMode));
   591 
   592 	iEventStore.AppendL(TRawEvent::EKeyDown);
   593 	iEventStore.AppendL(TRawEvent::EKeyUp);
   594 	}
   595 
   596 CT_KeypadDriverData::~CT_KeypadDriverData()
   597 /**
   598  * Public destructor
   599  */
   600 	{
   601 	iConsole.Control(KRawEventModeOff);
   602 	iConsole.Destroy();
   603 
   604 	iPossibleScanCodeStrStore.Reset();
   605 	iPossibleScanCodeStrStore.Close();
   606 	iPossibleScanCodeStore.Reset();
   607 	iPossibleScanCodeStore.Close();
   608 	iPossibleModifierStrStore.Reset();
   609 	iPossibleModifierStrStore.Close();
   610 	iPossibleModifierStore.Reset();
   611 	iPossibleModifierStore.Close();
   612 	iAllPossibleKeysStrStore.Reset();
   613 	iAllPossibleKeysStrStore.Close();
   614 	iAllPossibleKeysStore.Reset();
   615 	iAllPossibleKeysStore.Close();
   616 	iCombinationStrStore.Reset();
   617 	iCombinationStrStore.Close();
   618 	iExpectedStore.Reset();
   619 	iExpectedStore.Close();
   620 	iActualStore.Reset();
   621 	iActualStore.Close();
   622 	iEventStore.Reset();
   623 	iEventStore.Close();
   624 
   625 	delete iActiveKey;
   626 	delete iActiveCombination;
   627 	delete iActiveKeypadState;
   628 	delete iActivePrompt;
   629 	}
   630 
   631 TAny* CT_KeypadDriverData::GetObject()
   632 /**
   633  * Return a pointer to the object that the data wraps
   634  *
   635  * @return	pointer to the object that the data wraps
   636  */
   637 	{
   638 	return NULL;
   639 	}
   640 
   641 //	An empty function to ensure that the code will work fine with HAL_Data
   642 TBool CT_KeypadDriverData::GetPrepareNothing(CDataWrapperBase* /*aThis*/, const TDesC& /*aSection*/, TInt& /*aValueStart*/, TInt& /*aValueEnd*/)
   643 	{
   644 	return ETrue;
   645 	}
   646 
   647 //	Store the keypad state
   648 void CT_KeypadDriverData::SetKeyboardState(CDataWrapperBase* aThis, TInt aValue)
   649 	{
   650 	static_cast<CT_KeypadDriverData*>(aThis)->iKeyboardState=aValue;
   651 	}
   652 
   653 //	Store the keypad type
   654 void CT_KeypadDriverData::SetKeyboard(CDataWrapperBase* aThis, TInt aValue)
   655 	{
   656 	static_cast<CT_KeypadDriverData*>(aThis)->iKeyboard=aValue;
   657 	}
   658 
   659 //	Store the amount of keypad device keys
   660 void CT_KeypadDriverData::SetKeyboardDeviceKeys(CDataWrapperBase* aThis, TInt aValue)
   661 	{
   662 	static_cast<CT_KeypadDriverData*>(aThis)->iKeyboardDeviceKeys=aValue;
   663 	}
   664 
   665 //	Store the amount of keypad app keys
   666 void CT_KeypadDriverData::SetKeyboardAppKeys(CDataWrapperBase* aThis, TInt aValue)
   667 	{
   668 	static_cast<CT_KeypadDriverData*>(aThis)->iKeyboardAppKeys=aValue;
   669 	}
   670 
   671 //	Store the keypad click indicator
   672 void CT_KeypadDriverData::SetKeyboardClick(CDataWrapperBase* aThis, TInt aValue)
   673 	{
   674 	static_cast<CT_KeypadDriverData*>(aThis)->iKeyboardClick=aValue;
   675 	}
   676 
   677 //	Store the keypad max click volume
   678 void CT_KeypadDriverData::SetKeyboardClickVolumeMax(CDataWrapperBase* aThis, TInt aValue)
   679 	{
   680 	static_cast<CT_KeypadDriverData*>(aThis)->iKeyboardClickVolumeMax=aValue;
   681 	}
   682 
   683 //	Store the keypad click state
   684 void CT_KeypadDriverData::SetKeyboardClickState(CDataWrapperBase* aThis, TInt aValue)
   685 	{
   686 	static_cast<CT_KeypadDriverData*>(aThis)->iKeyboardClickState=aValue;
   687 	}
   688 
   689 //	Store the keypad click volume
   690 void CT_KeypadDriverData::SetKeyboardClickVolume(CDataWrapperBase* aThis, TInt aValue)
   691 	{
   692 	static_cast<CT_KeypadDriverData*>(aThis)->iKeyboardClickVolume=aValue;
   693 	}
   694 
   695 TBool CT_KeypadDriverData::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
   696 /**
   697  * Process a command read from the ini file
   698  *
   699  * @param aCommand			The command to process
   700  * @param aSection			The section in the ini containing data for the command
   701  * @param aAsyncErrorIndex	Command index for async calls to return errors to
   702  *
   703  * @return					ETrue if the command is processed
   704  *
   705  * @leave					System wide error
   706  */
   707 	{
   708 	TBool	ret = ETrue;
   709 
   710 	if ( aCommand == KGetScanCodes )
   711 		{
   712 		DoCmdGetScanCodesL(aSection);
   713 		}
   714 	else if ( aCommand == KGetModifiers )
   715 		{
   716 		DoCmdGetModifiersL(aSection);
   717 		}
   718 	else if ( aCommand == KTestAllKeys )
   719 		{
   720 		DoCmdTestAllKeysL(aAsyncErrorIndex);
   721 		}
   722 	else if ( aCommand == KTestOneModifierOneOtherKey )
   723 		{
   724 		DoCmdTestOneModifierOneOtherKeyL(aSection, aAsyncErrorIndex);
   725 		}
   726 	else if ( aCommand == KTestTwoKeys )
   727 		{
   728 		DoCmdTestTwoKeysL(aSection, aAsyncErrorIndex);
   729 		}
   730 	else if ( aCommand == KTestMultipleKeys )
   731 		{
   732 		DoCmdTestMultipleKeysL(aSection, aAsyncErrorIndex);
   733 		}
   734 	else if ( aCommand == KVerifyKeypadState )
   735 		{
   736 		DoCmdVerifyKeypadState(aSection, aAsyncErrorIndex);
   737 		}
   738 	else if ( aCommand == KPromptUser )
   739 		{
   740 		DoCmdPromptUser(aSection, aAsyncErrorIndex);
   741 		}
   742 	else
   743 		{
   744 		ret = CT_HALData::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
   745 		}
   746 
   747 	return ret;
   748 	}
   749 
   750 
   751 void CT_KeypadDriverData::DoCmdGetScanCodesL(const TDesC& aSection)
   752 /**
   753  * Get the scancodes of the platform
   754  *
   755  * @param aSection			The section in the ini containing data for the command
   756  *
   757  * @return					void
   758  *
   759  * @leave					System wide error
   760  */
   761 	{
   762 	iPossibleScanCodeStrStore.Reset();
   763 	iPossibleScanCodeStore.Reset();
   764 	iAllPossibleKeysStrStore.Reset();
   765 	iAllPossibleKeysStore.Reset();
   766 
   767 	TIniDataName	tempStore;
   768 	TPtrC			scanCodeStr;
   769 	TPtrC			scanCodeName;
   770 	TInt		 	scanCode;
   771 
   772 	TInt	index=0;
   773 	TBool	moreData=ETrue;
   774 	while ( moreData )
   775 		{
   776 		++index;
   777 		tempStore.Format(KScanCodeString(), index);
   778 		moreData=GetStringFromConfig(aSection, tempStore, scanCodeStr);
   779 		if ( moreData )
   780 			{
   781 			tempStore.Format(KScanCode(), index);
   782 			if (!GetEnumFromConfig(aSection, tempStore, iEnumTableScanCodes, scanCode))
   783 				{
   784 				ERR_PRINTF2(_L("Invalid scancode value: %d"), scanCode);
   785 				SetBlockResult(EFail);
   786 				}
   787 			else
   788 				{
   789 				iPossibleScanCodeStrStore.AppendL(scanCodeStr);
   790 				iPossibleScanCodeStore.AppendL(scanCode);
   791 
   792 				iAllPossibleKeysStrStore.AppendL(scanCodeStr);
   793 				iAllPossibleKeysStore.AppendL(scanCode);
   794 				}
   795 			}
   796 		}
   797 	}
   798 
   799 void CT_KeypadDriverData::DoCmdGetModifiersL(const TDesC& aSection)
   800 /**
   801  * Get the modifiers of the platform
   802  *
   803  * @param aSection			The section in the ini containing data for the command
   804  *
   805  * @return					void
   806  *
   807  * @leave					System wide error
   808  */
   809 	{
   810 	iPossibleModifierStrStore.Reset();
   811 	iPossibleModifierStore.Reset();
   812 
   813 	TIniDataName	tempStore;
   814 	TPtrC			modifierStr;
   815 	TInt			modifier;
   816 
   817 	TInt	index=0;
   818 	TBool	moreData=ETrue;
   819 	while ( moreData )
   820 		{
   821 		++index;
   822 		tempStore.Format(KModifierString(), index);
   823 		moreData=GetStringFromConfig(aSection, tempStore, modifierStr);
   824 		if ( moreData )
   825 			{
   826 			tempStore.Format(KModifier(), index);
   827 			if (!GetEnumFromConfig(aSection, tempStore, iEnumTableScanCodes, modifier))
   828 				{
   829 				ERR_PRINTF2(_L("Invalid modifier value: %d"), modifier);
   830 				SetBlockResult(EFail);
   831 				}
   832 			else
   833 				{
   834 				iPossibleModifierStrStore.AppendL(modifierStr);
   835 				iPossibleModifierStore.AppendL(modifier);
   836 
   837 				iAllPossibleKeysStrStore.AppendL(modifierStr);
   838 				iAllPossibleKeysStore.AppendL(modifier);
   839 				}
   840 			}
   841 		}
   842 	}
   843 
   844 void CT_KeypadDriverData::DoCmdTestAllKeysL(const TInt aAsyncErrorIndex)
   845 /**
   846  * Tests one key at the time by verifying the actual scancode against expected value
   847  *
   848  * @param aSection			The section in the ini containing data for the command
   849  *
   850  * @return					void
   851  *
   852  * @leave					System wide error
   853  */
   854 	{
   855 	iExpectedStore.Reset();
   856 	iActualStore.Reset();
   857 	iConsole.ClearScreen();
   858 
   859 	iKeyCount=0;
   860 	for ( TInt key=0; key<iAllPossibleKeysStore.Count(); ++key )
   861 		{
   862 		for ( TInt event=0; event<iEventStore.Count(); ++event )
   863 			{
   864 			iExpectedStore.AppendL(iEventStore[event]);
   865 			iExpectedStore.AppendL(iAllPossibleKeysStore[key]);
   866 			}
   867 		}
   868 
   869 	//end of setup and start testcase
   870 	iConsole.Write(_L("Keyboard layout test.\n"));
   871 	iConsole.Write(_L("Press the key corresponding to the "));
   872 
   873 	iConsole.Write(iAllPossibleKeysStrStore[iKeyCount]);
   874 
   875 	iConsole.Read(iKey, iActiveKey->iStatus);
   876 	iActiveKey->Activate( aAsyncErrorIndex );
   877 	IncOutstanding(); 	// request an event
   878 	}
   879 
   880 
   881 void CT_KeypadDriverData::DoCmdTestOneModifierOneOtherKeyL(const TDesC& aSection, const TInt aAsyncErrorIndex)
   882 /**
   883  * Tests one modifier + key combinations by verifying their scancodes against expected values
   884  *
   885  * @param aSection			The section in the ini containing data for the command
   886  *
   887  * @return					void
   888  *
   889  * @leave					System wide error
   890  */
   891 	{
   892 	iCombinationStrStore.Reset();
   893 	iExpectedStore.Reset();
   894 	iActualStore.Reset();
   895 	iConsole.ClearScreen();
   896 	iCombinationCount  	 = 0;
   897 	iCombinationKeyCount = 0;
   898 
   899 	TInt	divider 	 = 1;
   900 	TBool	dataOk=GetEnumFromConfig(aSection, KTestCoverage, iEnumTableCoverage, divider);
   901 	if ( !dataOk )
   902 		{
   903 		ERR_PRINTF2(KLogMissingParameter, &KTestCoverage());
   904 		SetBlockResult(EFail);
   905 		}
   906 	else
   907 		{
   908 		TInt	modifierCount 	= iPossibleModifierStore.Count();
   909 		TInt	keyCount	  	= (TInt)(iPossibleScanCodeStore.Count() / divider);
   910 
   911 		if (divider != 1)
   912 			{
   913 			++keyCount;
   914 			}
   915 
   916 		for ( TInt key=0; key<keyCount; ++key )
   917 			{
   918 			for ( TInt modifier=0; modifier<modifierCount; ++modifier )
   919 				{
   920 				for ( TInt event=0; event<iEventStore.Count(); ++event )
   921 					{
   922 					iExpectedStore.AppendL(iEventStore[event]);
   923 					iExpectedStore.AppendL(iPossibleModifierStore[modifier]);
   924 					iExpectedStore.AppendL(iEventStore[event]);
   925 					iExpectedStore.AppendL(iPossibleScanCodeStore[key]);
   926 					}
   927 
   928 				TIniDataName	tempStrArray;
   929 				tempStrArray.Append(iPossibleModifierStrStore[modifier]);
   930 				tempStrArray.Append(_L(" + "));
   931 				tempStrArray.Append(iPossibleScanCodeStrStore[key]);
   932 				iCombinationStrStore.Append(tempStrArray);
   933 				}
   934 			}
   935 
   936 		if ( iExpectedStore.Count()>0 )
   937 			{//end of setup and start testcase
   938 			iConsole.Write(_L("Keyboard layout test.\n"));
   939 			iConsole.Write(_L("Press the following keys in the sequence as displayed:\n"));
   940 			iConsole.Write(iCombinationStrStore[iCombinationCount]);
   941 			iConsole.Write(_L("\n"));
   942 			iConsole.Write(_L("and release them in the same sequence."));
   943 
   944 			iConsole.Read(iKey, iActiveCombination->iStatus);
   945 			iActiveCombination->Activate( aAsyncErrorIndex );
   946 			IncOutstanding(); 	// request an event*/
   947 			}
   948 		else
   949 			{
   950 			INFO_PRINTF1(_L("No modifiers and/or keys available or too small test coverage set"));
   951 			}
   952 		}
   953 	}
   954 
   955 void CT_KeypadDriverData::DoCmdTestTwoKeysL(const TDesC& aSection, const TInt aAsyncErrorIndex)
   956 /**
   957  * Tests key + key combinations by verifying their scancodes against expected values
   958  *
   959  * @param aSection			The section in the ini containing data for the command
   960  *
   961  * @return					void
   962  *
   963  * @leave					System wide error
   964  */
   965  	{
   966 	iCombinationStrStore.Reset();
   967 	iExpectedStore.Reset();
   968 	iActualStore.Reset();
   969 	iConsole.ClearScreen();
   970 	iCombinationCount		= 0;
   971 	iCombinationKeyCount	= 0;
   972 
   973 	TInt	divider			= 1;
   974 	TBool	dataOk=GetEnumFromConfig(aSection, KTestCoverage, iEnumTableCoverage, divider);
   975 	if ( !dataOk )
   976 		{
   977 		ERR_PRINTF2(KLogMissingParameter, &KTestCoverage());
   978 		SetBlockResult(EFail);
   979 		}
   980 	else
   981 		{
   982 		TInt	keyCount=(TInt)(iPossibleScanCodeStore.Count() / divider);
   983 
   984 		if (divider != 1)
   985 			{
   986 			++keyCount;
   987 			}
   988 
   989 		for ( TInt key1=0; key1<keyCount; ++key1 )
   990 			{
   991 			for ( TInt key2= 0; key2<keyCount; ++key2 )
   992 				{
   993 				if ( iPossibleScanCodeStore[key1]!=iPossibleScanCodeStore[key2] )
   994 					{
   995 					for ( TInt event=0; event<iEventStore.Count(); ++event )
   996 						{
   997 						iExpectedStore.AppendL(iEventStore[event]);
   998 						iExpectedStore.AppendL(iPossibleScanCodeStore[key1]);
   999 						iExpectedStore.AppendL(iEventStore[event]);
  1000 						iExpectedStore.AppendL(iPossibleScanCodeStore[key2]);
  1001 						}
  1002 
  1003 					TIniDataName	tempStrArray;
  1004 					tempStrArray.Append(iPossibleScanCodeStrStore[key1]);
  1005 					tempStrArray.Append(_L(" + "));
  1006 					tempStrArray.Append(iPossibleScanCodeStrStore[key2]);
  1007 					iCombinationStrStore.Append(tempStrArray);
  1008 					}
  1009 				}
  1010 			}
  1011 
  1012 		if ( iExpectedStore.Count()>0 )
  1013 			{//end of setup and start testcase
  1014 			iConsole.Write(_L("Keyboard layout test.\n"));
  1015 			iConsole.Write(_L("Press the following keys in the sequence as displayed:\n"));
  1016 			iConsole.Write(iCombinationStrStore[iCombinationCount]);
  1017 			iConsole.Write(_L("\n"));
  1018 			iConsole.Write(_L("and release them in the same sequence."));
  1019 
  1020 			iConsole.Read(iKey, iActiveCombination->iStatus);
  1021 			iActiveCombination->Activate( aAsyncErrorIndex );
  1022 			IncOutstanding(); 	// request an event*/
  1023 			}
  1024 		else
  1025 			{
  1026 			INFO_PRINTF1(_L("No keys available or too small test coverage set"));
  1027 			}
  1028 		}
  1029 	}
  1030 
  1031 void CT_KeypadDriverData::DoCmdTestMultipleKeysL(const TDesC& aSection, const TInt aAsyncErrorIndex)
  1032 /**
  1033  * Tests multiple key combinations by verifying their scancodes against expected values
  1034  *
  1035  * @param aSection			The section in the ini containing data for the command
  1036  *
  1037  * @return					void
  1038  *
  1039  * @leave					System wide error
  1040  */
  1041  	{
  1042 	iCombinationStrStore.Reset();
  1043 	iExpectedStore.Reset();
  1044 	iActualStore.Reset();
  1045 	iCombinationKeyCount = 0;
  1046 	iConsole.ClearScreen();
  1047 
  1048 	RArray<TInt>	keyStore;
  1049 	RArray<TPtrC>	keyStrStore;
  1050 
  1051 	keyStore.Reset();
  1052 	keyStrStore.Reset();
  1053 
  1054 	TIniDataName	setStore;
  1055 	TIniDataName	strStore;
  1056 	TIniDataName	fullStore;
  1057 	TPtrC			scanCodeStr;
  1058 	TInt			scanCode;
  1059 
  1060 	TInt	setIndex=0;
  1061 	TBool	moreSets=ETrue;
  1062 	while ( moreSets )
  1063 		{
  1064 		++setIndex;
  1065 
  1066 		keyStore.Reset();
  1067 		keyStrStore.Reset();
  1068 
  1069 		setStore.Format(KSet(), setIndex);
  1070 		setStore.Append(_L("_"));
  1071 
  1072 		TInt	index	=0;
  1073 		TBool	moreData=ETrue;
  1074 		while ( moreData )
  1075 			{
  1076 			++index;
  1077 
  1078 			fullStore 	= _L("");
  1079 			strStore.Format(KScanCodeString(), index);
  1080 			fullStore.Append(setStore);
  1081 			fullStore.Append(strStore);
  1082 
  1083 			moreData=GetStringFromConfig(aSection, fullStore, scanCodeStr);
  1084 			if ( moreData )
  1085 				{
  1086 				fullStore = _L("");
  1087 				strStore.Format(KScanCode(), index);
  1088 				fullStore.Append(setStore);
  1089 				fullStore.Append(strStore);
  1090 
  1091 				if (!GetEnumFromConfig(aSection, fullStore, iEnumTableScanCodes, scanCode))
  1092 					{
  1093 					ERR_PRINTF2(_L("Invalid scancode value: %d"), scanCode);
  1094 					SetBlockResult(EFail);
  1095 					}
  1096 				else
  1097 					{
  1098 					keyStrStore.AppendL(scanCodeStr);
  1099 					keyStore.AppendL(scanCode);
  1100 					}
  1101 				++index;
  1102 				}
  1103 			else
  1104 				{
  1105 				if (index == 1)
  1106 					{
  1107 					moreSets = EFalse;
  1108 					}
  1109 				}
  1110 			}
  1111 
  1112 		if (moreSets)
  1113 			{
  1114 			TInt	keyCount=keyStore.Count();
  1115 			for ( TInt event=0; event<iEventStore.Count(); ++event )
  1116 				{
  1117 				for ( TInt key=0; key<keyCount; ++key )
  1118 					{
  1119 					iExpectedStore.AppendL(iEventStore[event]);
  1120 					iExpectedStore.AppendL(keyStore[key]);
  1121 					}
  1122 				}
  1123 
  1124 			TIniDataName	tempStrArray;
  1125 			for ( TInt key=0; key<keyCount; ++key )
  1126 				{
  1127 				if (tempStrArray == _L(""))
  1128 					{
  1129 					tempStrArray.Append(keyStrStore[key]);
  1130 					}
  1131 				else
  1132 					{
  1133 					tempStrArray.Append(_L(" + "));
  1134 					tempStrArray.Append(keyStrStore[key]);
  1135 					}
  1136 				}
  1137 
  1138 			iCombinationStrStore.Append(tempStrArray);
  1139 			}
  1140 		}
  1141 
  1142 	keyStore.Reset();
  1143 	keyStore.Close();
  1144 	keyStrStore.Reset();
  1145 	keyStrStore.Close();
  1146 
  1147 	if (iExpectedStore.Count() > 0)
  1148 		{//end of setup and start testcase
  1149 		iConsole.Write(_L("Keyboard layout test.\n"));
  1150 		iConsole.Write(_L("Press the following keys in the sequence as displayed:\n"));
  1151 		iConsole.Write(iCombinationStrStore[0]);
  1152 		iConsole.Write(_L("\n"));
  1153 		iConsole.Write(_L("and release them in the same sequence."));
  1154 
  1155 		iConsole.Read(iKey, iActiveCombination->iStatus);
  1156 		iActiveCombination->Activate( aAsyncErrorIndex );
  1157 		IncOutstanding(); 	// request an event
  1158 		}
  1159 	else
  1160 		{
  1161 		INFO_PRINTF1(_L("No multiple key sets available"));
  1162 		}
  1163 	}
  1164 
  1165 
  1166 void CT_KeypadDriverData::DoCmdVerifyKeypadState(const TDesC& aSection, const TInt aAsyncErrorIndex)
  1167 /**
  1168  * Function for verifying the keypad state manually if running manual tests
  1169  *
  1170  * @param aSection			The section in the ini containing data for the command
  1171  *
  1172  * @return					void
  1173  *
  1174  * @leave					System wide error
  1175  */
  1176 	{
  1177 	iExpectedState = 0;
  1178 	GetIntFromConfig(aSection, KExpectedState(), iExpectedState);
  1179 
  1180 	TInt	timeOut=0;
  1181 	GetIntFromConfig(aSection, KTimeOut(), timeOut);
  1182 
  1183 	TIniDataName	seconds;
  1184 	seconds.Format(_L("%d"), timeOut / 1000000);
  1185 
  1186 	iConsole.ClearScreen();
  1187 	iConsole.Write(_L("Manual tests enabled...\n"));
  1188 	iConsole.Write(_L("Press any key within "));
  1189 	iConsole.Write(seconds);
  1190 	iConsole.Write(_L(" seconds to check the keypad state..."));
  1191 
  1192 	iConsole.Read(iKey, iActiveKeypadState->iStatus);
  1193 	iActiveKeypadState->Activate( aAsyncErrorIndex, timeOut );
  1194 	IncOutstanding(); 	// request an event
  1195 	}
  1196 
  1197 
  1198 void CT_KeypadDriverData::DoCmdPromptUser(const TDesC& aSection, const TInt aAsyncErrorIndex)
  1199 /**
  1200  * Function for verifying the volume manually if running manual tests
  1201  *
  1202  * @param aSection			The section in the ini containing data for the command
  1203  *
  1204  * @return					void
  1205  *
  1206  * @leave					System wide error
  1207  */
  1208 	{
  1209 	iFailTest = EFalse;
  1210 	GetBoolFromConfig(aSection, KFailTest(), iFailTest);
  1211 
  1212 	if ( !GetStringFromConfig(aSection, KUserPrompt(), iUserPromptStr) )
  1213 		{
  1214 		ERR_PRINTF2(KLogMissingParameter, &KUserPrompt());
  1215 		SetBlockResult(EFail);
  1216 		}
  1217 	else
  1218 		{
  1219 		iConsole.ClearScreen();
  1220 		iConsole.Write(_L("Manual tests enabled...\n"));
  1221 		iConsole.Write(iUserPromptStr);
  1222 
  1223 		if(iFailTest)
  1224 			{
  1225 			GetStringFromConfig(aSection, KPassKeyStr, iPassKeyStr);
  1226 			GetEnumFromConfig(aSection, KPassKey, iEnumTableScanCodes, iPassKey);
  1227 
  1228 			iConsole.Write(_L("Press "));
  1229 			iConsole.Write(iPassKeyStr);
  1230 			iConsole.Write(_L(" to pass the test or any other key to fail->>>"));
  1231 			}
  1232 		else
  1233 			{
  1234 			iConsole.Write(_L("Press any key to continue->>>"));
  1235 			}
  1236 
  1237 		iConsole.Read(iKey, iActivePrompt->iStatus);
  1238 		iActivePrompt->Activate( aAsyncErrorIndex );
  1239 		IncOutstanding(); 	// request an event
  1240 		}
  1241 	}
  1242 
  1243 
  1244 void CT_KeypadDriverData::DoCancel(CActive* aActive, TInt /*aIndex*/)
  1245 	{
  1246 	if( aActive == iActiveKeypadState )
  1247 		{
  1248 		INFO_PRINTF1(_L("Keypad state DoCancel called"));
  1249 
  1250 		iConsole.ReadCancel();
  1251 		DecOutstanding();
  1252 
  1253 		if(iExpectedState == 1)
  1254 			{
  1255 			ERR_PRINTF1(_L("No key press detected. Expected state is 1 (on)"));
  1256 			SetBlockResult(EFail);
  1257 			}
  1258 		else
  1259 			{
  1260 			INFO_PRINTF2(_L("Key press result is corresponding to the expected state: %d"), iExpectedState);
  1261 			}
  1262 		}
  1263 	else
  1264 		{
  1265 		ERR_PRINTF1(_L("An unchecked active object cancelled"));
  1266 		SetBlockResult(EFail);
  1267 		}
  1268 	}
  1269 
  1270 void CT_KeypadDriverData::RunL(CActive* aActive, TInt aIndex)
  1271 	{
  1272 	DecOutstanding();
  1273 	TBool	straySignal		= EFalse;
  1274 	TBool	furtherRequest	= EFalse;
  1275 
  1276 	TBool	isCombination	= EFalse;
  1277 	TBool	isPrompt		= EFalse;
  1278 
  1279 	if( aActive == iActiveKey )
  1280 		{
  1281 		INFO_PRINTF1(_L("RunL called"));
  1282 
  1283 		isCombination			= EFalse;
  1284 		isPrompt				= EFalse;
  1285 		TInt	eventType		= iKey.Type();
  1286 		TInt	scanCode		= iKey.Code();
  1287 
  1288 		if( eventType == TRawEvent::EKeyDown || eventType == TRawEvent::EKeyUp)
  1289 			{
  1290 			INFO_PRINTF2(_L("Raw Event: %d"), eventType);
  1291 
  1292 			iActualStore.AppendL(eventType);
  1293 			iActualStore.AppendL(scanCode);
  1294 
  1295 			INFO_PRINTF2(_L("Expected scancode string: %S"), &iAllPossibleKeysStrStore[iKeyCount]);
  1296 			INFO_PRINTF2(_L("Actual scancode: %d"), scanCode);
  1297 
  1298 			if (eventType == TRawEvent::EKeyUp)
  1299 				{
  1300 				if(iKeyCount < iAllPossibleKeysStore.Count() - 1)
  1301 					{
  1302 					furtherRequest = ETrue;
  1303 					iKeyCount++;
  1304 					}
  1305 				else
  1306 					{
  1307 					furtherRequest = EFalse;
  1308 					}
  1309 				}
  1310 			else
  1311 				{
  1312 				furtherRequest = ETrue;
  1313 				}
  1314 			}
  1315 		else
  1316 			{
  1317 			ERR_PRINTF2(_L("Unexpected Raw Event: %d"), eventType);
  1318 			SetBlockResult(EFail);
  1319 			furtherRequest = ETrue;
  1320 			}
  1321 		}
  1322 	else if( aActive == iActiveCombination )
  1323 		{
  1324 		INFO_PRINTF1(_L("RunL called"));
  1325 
  1326 		isCombination				= ETrue;
  1327 		isPrompt					= EFalse;
  1328 		TInt 	eventType			= iKey.Type();
  1329 		TInt	scanCode			= iKey.Code();
  1330 
  1331 		if( eventType == TRawEvent::EKeyDown )
  1332 			{
  1333 			INFO_PRINTF2(_L("Raw Event: %d"), eventType);
  1334 
  1335 			iActualStore.AppendL(eventType);
  1336 			iActualStore.AppendL(scanCode);
  1337 
  1338 			INFO_PRINTF2(_L("Expected scancode string: %S"), &iCombinationStrStore[iCombinationCount]);
  1339 			INFO_PRINTF2(_L("Actual scancode: %d"), scanCode);
  1340 
  1341 			iCombinationKeyCount++;
  1342 
  1343 			furtherRequest = ETrue;
  1344 			}
  1345 		else if ( eventType == TRawEvent::EKeyUp )
  1346 			{
  1347 			INFO_PRINTF2(_L("Raw Event: %d"), eventType);
  1348 
  1349 			iActualStore.AppendL(eventType);
  1350 			iActualStore.AppendL(scanCode);
  1351 
  1352 			INFO_PRINTF2(_L("Actual scancode: %d"), scanCode);
  1353 
  1354 			iCombinationKeyCount--;
  1355 
  1356 			if(iCombinationCount < iCombinationStrStore.Count() - 1 && iCombinationKeyCount == 0)
  1357 				{
  1358 				furtherRequest = ETrue;
  1359 				iCombinationCount++;
  1360 				}
  1361 			else if (iCombinationKeyCount != 0)
  1362 				{
  1363 				furtherRequest = ETrue;
  1364 				}
  1365 			else
  1366 				{
  1367 				furtherRequest = EFalse;
  1368 				}
  1369 			}
  1370 		else
  1371 			{
  1372 			ERR_PRINTF2(_L("Unexpected Raw Event: %d"), eventType);
  1373 			SetBlockResult(EFail);
  1374 			furtherRequest = ETrue;
  1375 			}
  1376 		}
  1377 	else if( aActive == iActiveKeypadState )
  1378 		{
  1379 		INFO_PRINTF1(_L("RunL called"));
  1380 
  1381 		TInt eventType = iKey.Type();
  1382 		TInt scanCode  = iKey.Code();
  1383 
  1384 		if(eventType == TRawEvent::EKeyDown && scanCode != 0)
  1385 			{
  1386 			iActiveKeypadState->KillTimer();
  1387 			DecOutstanding();
  1388 
  1389 			if(iExpectedState == 0)
  1390 				{
  1391 				ERR_PRINTF1(_L("Key press detected. Expected state is 0 (off)"));
  1392 				SetBlockResult(EFail);
  1393 				}
  1394 			else
  1395 				{
  1396 				INFO_PRINTF2(_L("Key press result is corresponding to the expected state: %d"), iExpectedState);
  1397 				}
  1398 			}
  1399 		}
  1400 	else if ( aActive == iActivePrompt )
  1401 		{
  1402 		INFO_PRINTF1(_L("Prompt RunL called"));
  1403 
  1404 		isCombination		= EFalse;
  1405 		isPrompt			= ETrue;
  1406 		TInt	eventType	= iKey.Type();
  1407 		TInt	scanCode	= iKey.Code();
  1408 
  1409 		if (iFailTest)
  1410 			{
  1411 			if(eventType == TRawEvent::EKeyDown && scanCode != iPassKey)
  1412 				{
  1413 				ERR_PRINTF1(_L("Test failed - User verifies that the result is not as expected"));
  1414 				SetBlockResult(EFail);
  1415 				furtherRequest = EFalse;
  1416 				}
  1417 			else if (eventType == TRawEvent::EKeyDown && scanCode == iPassKey)
  1418 				{
  1419 				INFO_PRINTF1(_L("Test passed - User verifies that the result is as expected"));
  1420 				furtherRequest = EFalse;
  1421 				}
  1422 			else if (eventType == TRawEvent::EKeyUp)
  1423 				{
  1424 				furtherRequest = ETrue;
  1425 				}
  1426 			else
  1427 				{
  1428 				ERR_PRINTF2(_L("Unexpected Raw Event: %d"), eventType);
  1429 				SetBlockResult(EFail);
  1430 				furtherRequest = ETrue;
  1431 				}
  1432 			}
  1433 		else
  1434 			{
  1435 			if(eventType == TRawEvent::EKeyDown)
  1436 				{
  1437 				INFO_PRINTF1(_L("Continuing..."));
  1438 				furtherRequest = EFalse;
  1439 				}
  1440 			else if (eventType == TRawEvent::EKeyUp)
  1441 				{
  1442 				furtherRequest = ETrue;
  1443 				}
  1444 			else
  1445 				{
  1446 				ERR_PRINTF2(_L("Unexpected Raw Event: %d"), eventType);
  1447 				SetBlockResult(EFail);
  1448 				furtherRequest = ETrue;
  1449 				}
  1450 			}
  1451 		}
  1452 	else
  1453 		{
  1454 		ERR_PRINTF1(_L("An unchecked active object completed"));
  1455 		SetBlockResult(EFail);
  1456 		straySignal = ETrue;
  1457 		}
  1458 
  1459 	if( !straySignal )
  1460 		{
  1461 		TInt	err = aActive->iStatus.Int();
  1462 		if( err != KErrNone )
  1463 			{
  1464 			if(aActive == iActiveKeypadState && err == KErrCancel)
  1465 				{
  1466 				if(iExpectedState == 1)
  1467 					{
  1468 					ERR_PRINTF1(_L("No key press detected. Expected state is 1 (on)"));
  1469 					SetBlockResult(EFail);
  1470 					}
  1471 				else
  1472 					{
  1473 					INFO_PRINTF2(_L("Key press result is corresponding to the expected state: %d"), iExpectedState);
  1474 					}
  1475 				}
  1476 			else
  1477 				{
  1478 				ERR_PRINTF2(_L("RunL Error %d"), err);
  1479 				SetAsyncError( aIndex, err );
  1480 				}
  1481 			}
  1482 		else
  1483 			{
  1484 			if(furtherRequest)// check if re-issue required
  1485 				{
  1486 				iConsole.ClearScreen();
  1487 				INFO_PRINTF1(_L("Re-issuing Read"));
  1488 
  1489 				if(!isCombination && !isPrompt)
  1490 					{
  1491 					iConsole.Write(_L("Press the key corresponding to the "));
  1492 					iConsole.Write(iAllPossibleKeysStrStore[iKeyCount]);
  1493 
  1494 					iConsole.Read(iKey, iActiveKey->iStatus);
  1495 					iActiveKey->Activate(aIndex);
  1496 					IncOutstanding();
  1497 					}
  1498 				else if (!isPrompt)
  1499 					{
  1500 					iConsole.Write(_L("Press the following keys in the same sequence as displayed:\n"));
  1501 					iConsole.Write(iCombinationStrStore[iCombinationCount]);
  1502 					iConsole.Write(_L("\n"));
  1503 					iConsole.Write(_L("and release them in the same sequence."));
  1504 
  1505 					iConsole.Read(iKey, iActiveCombination->iStatus);
  1506 					iActiveCombination->Activate(aIndex);
  1507 					IncOutstanding();
  1508 					}
  1509 				else{
  1510 					iConsole.Write(iUserPromptStr);
  1511 
  1512 					if(iFailTest)
  1513 						{
  1514 						iConsole.Write(_L("Press "));
  1515 						iConsole.Write(iPassKeyStr);
  1516 						iConsole.Write(_L(" to pass the test or any other key to fail->>>"));
  1517 						}
  1518 					else
  1519 						{
  1520 						iConsole.Write(_L("Press any key to continue->>>"));
  1521 						}
  1522 
  1523 					iConsole.Read(iKey, iActivePrompt->iStatus);
  1524 					iActivePrompt->Activate( aIndex );
  1525 					IncOutstanding();
  1526 					}
  1527 				}
  1528 			else
  1529 				{
  1530 				if(aActive == iActiveKeypadState)
  1531 					{
  1532 					if ( iExpectedState == 0 )
  1533 						{
  1534 						ERR_PRINTF1(_L("Expected state is 0 (off). Verifying keypad state should have been cancelled."));
  1535 						SetBlockResult(EFail);
  1536 						}
  1537 					else
  1538 						{
  1539 						INFO_PRINTF2(_L("Key press result is corresponding to the expected state: %d"), iExpectedState);
  1540 						}
  1541 					}
  1542 				else
  1543 					{
  1544 					INFO_PRINTF1(_L("RunL call completed successfully"));
  1545 					ProcessResults();	//process results
  1546 					}
  1547 				}
  1548 			}
  1549 		}
  1550 	}
  1551 
  1552 void CT_KeypadDriverData::ProcessResults()
  1553 	{
  1554 	INFO_PRINTF1(_L("Processing results"));
  1555 
  1556 	if (iActualStore.Count() == iExpectedStore.Count())
  1557 		{
  1558 		for(TInt i = 0; i < iActualStore.Count(); i+=2)
  1559 			{
  1560 			if(	iActualStore[i] != iExpectedStore[i]	)//compare event
  1561 				{
  1562 				ERR_PRINTF3(_L("Expected event (%d) does not match Actual event (%d)! "), iExpectedStore[i], iActualStore[i]);
  1563 				SetBlockResult(EFail);
  1564 				}
  1565 			else
  1566 				{
  1567 				INFO_PRINTF2(_L("Expected event was: %d, Actual event matches the expected one."), iExpectedStore[i]);
  1568 				}
  1569 
  1570 			if(iActualStore[i+1] == iExpectedStore[i+1])
  1571 				{
  1572 				INFO_PRINTF2(_L("Expected scancode was: %d. Actual scancode matches the expected one."), iExpectedStore[i+1]);
  1573 				}
  1574 			else
  1575 				{
  1576 				ERR_PRINTF3(_L("Actual scancode (%d) != expected scancode (%d)"), iActualStore[i+1], iExpectedStore[i+1]);
  1577 				SetBlockResult(EFail);
  1578 				}
  1579 			}
  1580 		}
  1581 	else
  1582 		{
  1583 		ERR_PRINTF3(_L("Actual results array count (%d) != expected results array count (%d)"), iActualStore.Count(), iExpectedStore.Count());
  1584 		SetBlockResult(EFail);
  1585 		}
  1586 	}