os/boardsupport/haitest/bspsvs/suite/bsp/keypad/src/T_KeypadDriverData.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/boardsupport/haitest/bspsvs/suite/bsp/keypad/src/T_KeypadDriverData.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,1586 @@
     1.4 +/*
     1.5 +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +#include "T_KeypadDriverData.h"
    1.22 +
    1.23 +_LIT(KEnumNull,						" ");
    1.24 +_LIT(KGetScanCodes,					"GetScanCodes");
    1.25 +_LIT(KGetModifiers,					"GetModifiers");
    1.26 +_LIT(KTestAllKeys,					"TestAllKeys");
    1.27 +_LIT(KTestOneModifierOneOtherKey,	"TestOneModifierOneOtherKey");
    1.28 +_LIT(KTestTwoKeys,					"TestTwoKeys");
    1.29 +_LIT(KTestMultipleKeys,				"TestMultipleKeys");
    1.30 +_LIT(KVerifyKeypadState,			"VerifyKeypadState");
    1.31 +_LIT(KPromptUser,					"PromptUser");
    1.32 +_LIT(KSet,							"set%d");
    1.33 +_LIT(KScanCodeString,				"scancode_string%d");
    1.34 +_LIT(KScanCode,						"scancode%d");
    1.35 +_LIT(KModifierString,				"modifier_string%d");
    1.36 +_LIT(KModifier,						"modifier%d");
    1.37 +_LIT(KTestCoverage,					"test_coverage");
    1.38 +_LIT(KFailTest,						"fail_test");
    1.39 +_LIT(KPassKeyStr,					"pass_key_str");
    1.40 +_LIT(KPassKey,						"pass_key");
    1.41 +_LIT(KExpectedState,				"expected_state");
    1.42 +_LIT(KTimeOut,						"timeout");
    1.43 +_LIT(KUserPrompt,					"user_prompt");
    1.44 +_LIT(KConsoleName,					"Console_Window");
    1.45 +_LIT(KMaximized,					"+M");
    1.46 +_LIT(KRawEventMode,					"+R");
    1.47 +_LIT(KRawEventModeOff,				"-R");
    1.48 +
    1.49 +_LIT(KLogMissingParameter,			"Missing parameter '%S'");
    1.50 +/*@}*/
    1.51 +
    1.52 +// Scancodes
    1.53 +_LIT(KStdKeyNumber0,				"'0'");
    1.54 +_LIT(KStdKeyNumber1,				"'1'");
    1.55 +_LIT(KStdKeyNumber2,				"'2'");
    1.56 +_LIT(KStdKeyNumber3,				"'3'");
    1.57 +_LIT(KStdKeyNumber4,				"'4'");
    1.58 +_LIT(KStdKeyNumber5,				"'5'");
    1.59 +_LIT(KStdKeyNumber6,				"'6'");
    1.60 +_LIT(KStdKeyNumber7,				"'7'");
    1.61 +_LIT(KStdKeyNumber8,				"'8'");
    1.62 +_LIT(KStdKeyNumber9,				"'9'");
    1.63 +_LIT(KStdKeyLetterA,				"'A'");
    1.64 +_LIT(KStdKeyLetterB,				"'B'");
    1.65 +_LIT(KStdKeyLetterC,				"'C'");
    1.66 +_LIT(KStdKeyLetterD,				"'D'");
    1.67 +_LIT(KStdKeyLetterE,				"'E'");
    1.68 +_LIT(KStdKeyLetterF,				"'F'");
    1.69 +_LIT(KStdKeyLetterG,				"'G'");
    1.70 +_LIT(KStdKeyLetterH,				"'H'");
    1.71 +_LIT(KStdKeyLetterI,				"'I'");
    1.72 +_LIT(KStdKeyLetterJ,				"'J'");
    1.73 +_LIT(KStdKeyLetterK,				"'K'");
    1.74 +_LIT(KStdKeyLetterL,				"'L'");
    1.75 +_LIT(KStdKeyLetterM,				"'M'");
    1.76 +_LIT(KStdKeyLetterN,				"'N'");
    1.77 +_LIT(KStdKeyLetterO,				"'O'");
    1.78 +_LIT(KStdKeyLetterP,				"'P'");
    1.79 +_LIT(KStdKeyLetterQ,				"'Q'");
    1.80 +_LIT(KStdKeyLetterR,				"'R'");
    1.81 +_LIT(KStdKeyLetterS,				"'S'");
    1.82 +_LIT(KStdKeyLetterT,				"'T'");
    1.83 +_LIT(KStdKeyLetterU,				"'U'");
    1.84 +_LIT(KStdKeyLetterV,				"'V'");
    1.85 +_LIT(KStdKeyLetterW,				"'W'");
    1.86 +_LIT(KStdKeyLetterX,				"'X'");
    1.87 +_LIT(KStdKeyLetterY,				"'Y'");
    1.88 +_LIT(KStdKeyLetterZ,				"'Z'");
    1.89 +_LIT(KStdKeyAsterisk,				"'*'");
    1.90 +_LIT(KStdKeyNull,					"EStdKeyNull");
    1.91 +_LIT(KStdKeyBackspace,				"EStdKeyBackspace");
    1.92 +_LIT(KStdKeyTab,					"EStdKeyTab");
    1.93 +_LIT(KStdKeyEnter,					"EStdKeyEnter");
    1.94 +_LIT(KStdKeyEscape,					"EStdKeyEscape");
    1.95 +_LIT(KStdKeySpace,					"EStdKeySpace");
    1.96 +_LIT(KStdKeyPrintScreen,			"EStdKeyPrintScreen");
    1.97 +_LIT(KStdKeyPause,					"EStdKeyPause");
    1.98 +_LIT(KStdKeyHome,					"EStdKeyHome");
    1.99 +_LIT(KStdKeyEnd,					"EStdKeyEnd");
   1.100 +_LIT(KStdKeyPageUp,					"EStdKeyPageUp");
   1.101 +_LIT(KStdKeyPageDown,				"EStdKeyPageDown");
   1.102 +_LIT(KStdKeyInsert,					"EStdKeyInsert");
   1.103 +_LIT(KStdKeyDelete,					"EStdKeyDelete");
   1.104 +_LIT(KStdKeyLeftArrow,				"EStdKeyLeftArrow");
   1.105 +_LIT(KStdKeyRightArrow,				"EStdKeyRightArrow");
   1.106 +_LIT(KStdKeyUpArrow,				"EStdKeyUpArrow");
   1.107 +_LIT(KStdKeyDownArrow,				"EStdKeyDownArrow");
   1.108 +_LIT(KStdKeyLeftShift,				"EStdKeyLeftShift");
   1.109 +_LIT(KStdKeyRightShift,				"EStdKeyRightShift");
   1.110 +_LIT(KStdKeyLeftAlt,				"EStdKeyLeftAlt");
   1.111 +_LIT(KStdKeyRightAlt,				"EStdKeyRightAlt");
   1.112 +_LIT(KStdKeyLeftCtrl,				"EStdKeyLeftCtrl");
   1.113 +_LIT(KStdKeyRightCtrl,				"EStdKeyRightCtrl");
   1.114 +_LIT(KStdKeyLeftFunc,				"EStdKeyLeftFunc");
   1.115 +_LIT(KStdKeyRightFunc,				"EStdKeyRightFunc");
   1.116 +_LIT(KStdKeyCapsLock,				"EStdKeyCapsLock");
   1.117 +_LIT(KStdKeyNumLock,				"EStdKeyNumLock");
   1.118 +_LIT(KStdKeyScrollLock,				"EStdKeyScrollLock");
   1.119 +_LIT(KStdKeyF1,						"EStdKeyF1");
   1.120 +_LIT(KStdKeyF2,						"EStdKeyF2");
   1.121 +_LIT(KStdKeyF3,						"EStdKeyF3");
   1.122 +_LIT(KStdKeyF4,						"EStdKeyF4");
   1.123 +_LIT(KStdKeyF5,						"EStdKeyF5");
   1.124 +_LIT(KStdKeyF6,						"EStdKeyF6");
   1.125 +_LIT(KStdKeyF7,						"EStdKeyF7");
   1.126 +_LIT(KStdKeyF8,						"EStdKeyF8");
   1.127 +_LIT(KStdKeyF9,						"EStdKeyF9");
   1.128 +_LIT(KStdKeyF10,					"EStdKeyF10");
   1.129 +_LIT(KStdKeyF11,					"EStdKeyF11");
   1.130 +_LIT(KStdKeyF12,					"EStdKeyF12");
   1.131 +_LIT(KStdKeyF13,					"EStdKeyF13");
   1.132 +_LIT(KStdKeyF14,					"EStdKeyF14");
   1.133 +_LIT(KStdKeyF15,					"EStdKeyF15");
   1.134 +_LIT(KStdKeyF16,					"EStdKeyF16");
   1.135 +_LIT(KStdKeyF17,					"EStdKeyF17");
   1.136 +_LIT(KStdKeyF18,					"EStdKeyF18");
   1.137 +_LIT(KStdKeyF19,					"EStdKeyF19");
   1.138 +_LIT(KStdKeyF20,					"EStdKeyF20");
   1.139 +_LIT(KStdKeyF21,					"EStdKeyF21");
   1.140 +_LIT(KStdKeyF22,					"EStdKeyF22");
   1.141 +_LIT(KStdKeyF23,					"EStdKeyF23");
   1.142 +_LIT(KStdKeyF24,					"EStdKeyF24");
   1.143 +_LIT(KStdKeyXXX,					"EStdKeyXXX");
   1.144 +_LIT(KStdKeyComma,					"EStdKeyComma");
   1.145 +_LIT(KStdKeyFullStop,				"EStdKeyFullStop");
   1.146 +_LIT(KStdKeyForwardSlash,			"EStdKeyForwardSlash");
   1.147 +_LIT(KStdKeyBackSlash,				"EStdKeyBackSlash");
   1.148 +_LIT(KStdKeySemiColon,				"EStdKeySemiColon");
   1.149 +_LIT(KStdKeySingleQuote,			"EStdKeySingleQuote");
   1.150 +_LIT(KStdKeyHash,					"EStdKeyHash");
   1.151 +_LIT(KStdKeySquareBracketLeft,		"EStdKeySquareBracketLeft");
   1.152 +_LIT(KStdKeySquareBracketRight,		"EStdKeySquareBracketRight");
   1.153 +_LIT(KStdKeyMinus,					"EStdKeyMinus");
   1.154 +_LIT(KStdKeyEquals,					"EStdKeyEquals");
   1.155 +_LIT(KStdKeyNkpForwardSlash,		"EStdKeyNkpForwardSlash");
   1.156 +_LIT(KStdKeyNkpAsterisk,			"EStdKeyNkpAsterisk");
   1.157 +_LIT(KStdKeyNkpMinus,				"EStdKeyNkpMinus");
   1.158 +_LIT(KStdKeyNkpPlus,				"EStdKeyNkpPlus");
   1.159 +_LIT(KStdKeyNkpEnter,				"EStdKeyNkpEnter");
   1.160 +_LIT(KStdKeyNkp1,					"EStdKeyNkp1");
   1.161 +_LIT(KStdKeyNkp2,					"EStdKeyNkp2");
   1.162 +_LIT(KStdKeyNkp3,					"EStdKeyNkp3");
   1.163 +_LIT(KStdKeyNkp4,					"EStdKeyNkp4");
   1.164 +_LIT(KStdKeyNkp5,					"EStdKeyNkp5");
   1.165 +_LIT(KStdKeyNkp6,					"EStdKeyNkp6");
   1.166 +_LIT(KStdKeyNkp7,					"EStdKeyNkp7");
   1.167 +_LIT(KStdKeyNkp8,					"EStdKeyNkp8");
   1.168 +_LIT(KStdKeyNkp9,					"EStdKeyNkp9");
   1.169 +_LIT(KStdKeyNkp0,					"EStdKeyNkp0");
   1.170 +_LIT(KStdKeyNkpFullStop,			"EStdKeyNkpFullStop");
   1.171 +_LIT(KStdKeyMenu,					"EStdKeyMenu");
   1.172 +_LIT(KStdKeyBacklightOn,			"EStdKeyBacklightOn");
   1.173 +_LIT(KStdKeyBacklightOff,			"EStdKeyBacklightOff");
   1.174 +_LIT(KStdKeyBacklightToggle,		"EStdKeyBacklightToggle");
   1.175 +_LIT(KStdKeyIncContrast,			"EStdKeyIncContrast");
   1.176 +_LIT(KStdKeyDecContrast,			"EStdKeyDecContrast");
   1.177 +_LIT(KStdKeySliderDown,				"EStdKeySliderDown");
   1.178 +_LIT(KStdKeySliderUp,				"EStdKeySliderUp");
   1.179 +_LIT(KStdKeyDictaphonePlay,			"EStdKeyDictaphonePlay");
   1.180 +_LIT(KStdKeyDictaphoneStop,			"EStdKeyDictaphoneStop");
   1.181 +_LIT(KStdKeyDictaphoneRecord,		"EStdKeyDictaphoneRecord");
   1.182 +_LIT(KStdKeyHelp,					"EStdKeyHelp");
   1.183 +_LIT(KStdKeyOff,					"EStdKeyOff");
   1.184 +_LIT(KStdKeyDial,					"EStdKeyDial");
   1.185 +_LIT(KStdKeyIncVolume,				"EStdKeyIncVolume");
   1.186 +_LIT(KStdKeyDecVolume,				"EStdKeyDecVolume");
   1.187 +_LIT(KStdKeyDevice0,				"EStdKeyDevice0");
   1.188 +_LIT(KStdKeyDevice1,				"EStdKeyDevice1");
   1.189 +_LIT(KStdKeyDevice2,				"EStdKeyDevice2");
   1.190 +_LIT(KStdKeyDevice3,				"EStdKeyDevice3");
   1.191 +_LIT(KStdKeyDevice4,				"EStdKeyDevice4");
   1.192 +_LIT(KStdKeyDevice5,				"EStdKeyDevice5");
   1.193 +_LIT(KStdKeyDevice6,				"EStdKeyDevice6");
   1.194 +_LIT(KStdKeyDevice7,				"EStdKeyDevice7");
   1.195 +_LIT(KStdKeyDevice8,				"EStdKeyDevice8");
   1.196 +_LIT(KStdKeyDevice9,				"EStdKeyDevice9");
   1.197 +_LIT(KStdKeyDeviceA,				"EStdKeyDeviceA");
   1.198 +_LIT(KStdKeyDeviceB,				"EStdKeyDeviceB");
   1.199 +_LIT(KStdKeyDeviceC,				"EStdKeyDeviceC");
   1.200 +_LIT(KStdKeyDeviceD,				"EStdKeyDeviceD");
   1.201 +_LIT(KStdKeyDeviceE,				"EStdKeyDeviceE");
   1.202 +_LIT(KStdKeyDeviceF,				"EStdKeyDeviceF");
   1.203 +_LIT(KStdKeyApplication0,			"EStdKeyApplication0");
   1.204 +_LIT(KStdKeyApplication1,			"EStdKeyApplication1");
   1.205 +_LIT(KStdKeyApplication2,			"EStdKeyApplication2");
   1.206 +_LIT(KStdKeyApplication3,			"EStdKeyApplication3");
   1.207 +_LIT(KStdKeyApplication4,			"EStdKeyApplication4");
   1.208 +_LIT(KStdKeyApplication5,			"EStdKeyApplication5");
   1.209 +_LIT(KStdKeyApplication6,			"EStdKeyApplication6");
   1.210 +_LIT(KStdKeyApplication7,			"EStdKeyApplication7");
   1.211 +_LIT(KStdKeyApplication8,			"EStdKeyApplication8");
   1.212 +_LIT(KStdKeyApplication9,			"EStdKeyApplication9");
   1.213 +_LIT(KStdKeyApplicationA,			"EStdKeyApplicationA");
   1.214 +_LIT(KStdKeyApplicationB,			"EStdKeyApplicationB");
   1.215 +_LIT(KStdKeyApplicationC,			"EStdKeyApplicationC");
   1.216 +_LIT(KStdKeyApplicationD,			"EStdKeyApplicationD");
   1.217 +_LIT(KStdKeyApplicationE,			"EStdKeyApplicationE");
   1.218 +_LIT(KStdKeyApplicationF,			"EStdKeyApplicationF");
   1.219 +_LIT(KStdKeyYes,					"EStdKeyYes");
   1.220 +_LIT(KStdKeyNo,						"EStdKeyNo");
   1.221 +_LIT(KStdKeyIncBrightness,			"EStdKeyIncBrightness");
   1.222 +_LIT(KStdKeyDecBrightness,			"EStdKeyDecBrightness");
   1.223 +_LIT(KStdKeyKeyboardExtend,			"EStdKeyKeyboardExtend");
   1.224 +_LIT(KStdKeyDevice10,				"EStdKeyDevice10");
   1.225 +_LIT(KStdKeyDevice11,				"EStdKeyDevice11");
   1.226 +_LIT(KStdKeyDevice12,				"EStdKeyDevice12");
   1.227 +_LIT(KStdKeyDevice13,				"EStdKeyDevice13");
   1.228 +_LIT(KStdKeyDevice14,				"EStdKeyDevice14");
   1.229 +_LIT(KStdKeyDevice15,				"EStdKeyDevice15");
   1.230 +_LIT(KStdKeyDevice16,				"EStdKeyDevice16");
   1.231 +_LIT(KStdKeyDevice17,				"EStdKeyDevice17");
   1.232 +_LIT(KStdKeyDevice18,				"EStdKeyDevice18");
   1.233 +_LIT(KStdKeyDevice19,				"EStdKeyDevice19");
   1.234 +_LIT(KStdKeyDevice1A,				"EStdKeyDevice1A");
   1.235 +_LIT(KStdKeyDevice1B,				"EStdKeyDevice1B");
   1.236 +_LIT(KStdKeyDevice1C,				"EStdKeyDevice1C");
   1.237 +_LIT(KStdKeyDevice1D,				"EStdKeyDevice1D");
   1.238 +_LIT(KStdKeyDevice1E,				"EStdKeyDevice1E");
   1.239 +_LIT(KStdKeyDevice1F,				"EStdKeyDevice1F");
   1.240 +_LIT(KStdKeyApplication10,			"EStdKeyApplication10");
   1.241 +_LIT(KStdKeyApplication11,			"EStdKeyApplication11");
   1.242 +_LIT(KStdKeyApplication12,			"EStdKeyApplication12");
   1.243 +_LIT(KStdKeyApplication13,			"EStdKeyApplication13");
   1.244 +_LIT(KStdKeyApplication14,			"EStdKeyApplication14");
   1.245 +_LIT(KStdKeyApplication15,			"EStdKeyApplication15");
   1.246 +_LIT(KStdKeyApplication16,			"EStdKeyApplication16");
   1.247 +_LIT(KStdKeyApplication17,			"EStdKeyApplication17");
   1.248 +_LIT(KStdKeyApplication18,			"EStdKeyApplication18");
   1.249 +_LIT(KStdKeyApplication19,			"EStdKeyApplication19");
   1.250 +_LIT(KStdKeyApplication1A,			"EStdKeyApplication1A");
   1.251 +_LIT(KStdKeyApplication1B,			"EStdKeyApplication1B");
   1.252 +_LIT(KStdKeyApplication1C,			"EStdKeyApplication1C");
   1.253 +_LIT(KStdKeyApplication1D,			"EStdKeyApplication1D");
   1.254 +_LIT(KStdKeyApplication1E,			"EStdKeyApplication1E");
   1.255 +_LIT(KStdKeyApplication1F,			"EStdKeyApplication1F");
   1.256 +_LIT(KStdKeyDevice20,				"EStdKeyDevice20");
   1.257 +_LIT(KStdKeyDevice21,				"EStdKeyDevice21");
   1.258 +_LIT(KStdKeyDevice22,				"EStdKeyDevice22");
   1.259 +_LIT(KStdKeyDevice23,				"EStdKeyDevice23");
   1.260 +_LIT(KStdKeyDevice24,				"EStdKeyDevice24");
   1.261 +_LIT(KStdKeyDevice25,				"EStdKeyDevice25");
   1.262 +_LIT(KStdKeyDevice26,				"EStdKeyDevice26");
   1.263 +_LIT(KStdKeyDevice27,				"EStdKeyDevice27");
   1.264 +_LIT(KStdKeyApplication20,			"EStdKeyApplication20");
   1.265 +_LIT(KStdKeyApplication21,			"EStdKeyApplication21");
   1.266 +_LIT(KStdKeyApplication22,			"EStdKeyApplication22");
   1.267 +_LIT(KStdKeyApplication23,			"EStdKeyApplication23");
   1.268 +_LIT(KStdKeyApplication24,			"EStdKeyApplication24");
   1.269 +_LIT(KStdKeyApplication25,			"EStdKeyApplication25");
   1.270 +_LIT(KStdKeyApplication26,			"EStdKeyApplication26");
   1.271 +_LIT(KStdKeyApplication27,			"EStdKeyApplication27");
   1.272 +const CDataWrapperBase::TEnumEntryTable	CT_KeypadDriverData::iEnumTableScanCodes[] =
   1.273 +	{
   1.274 +//	Scancode as a descriptor		Scancode
   1.275 +	KStdKeyNumber0,					(TStdScanCode) '0',
   1.276 +	KStdKeyNumber1,					(TStdScanCode) '1',
   1.277 +	KStdKeyNumber2,					(TStdScanCode) '2',
   1.278 +	KStdKeyNumber3,					(TStdScanCode) '3',
   1.279 +	KStdKeyNumber4,					(TStdScanCode) '4',
   1.280 +	KStdKeyNumber5,					(TStdScanCode) '5',
   1.281 +	KStdKeyNumber6,					(TStdScanCode) '6',
   1.282 +	KStdKeyNumber7,					(TStdScanCode) '7',
   1.283 +	KStdKeyNumber8,					(TStdScanCode) '8',
   1.284 +	KStdKeyNumber9,					(TStdScanCode) '9',
   1.285 +	KStdKeyLetterA,					(TStdScanCode) 'A',
   1.286 +	KStdKeyLetterB,					(TStdScanCode) 'B',
   1.287 +	KStdKeyLetterC,					(TStdScanCode) 'C',
   1.288 +	KStdKeyLetterD,					(TStdScanCode) 'D',
   1.289 +	KStdKeyLetterE,					(TStdScanCode) 'E',
   1.290 +	KStdKeyLetterF,					(TStdScanCode) 'F',
   1.291 +	KStdKeyLetterG,					(TStdScanCode) 'G',
   1.292 +	KStdKeyLetterH,					(TStdScanCode) 'H',
   1.293 +	KStdKeyLetterI,					(TStdScanCode) 'I',
   1.294 +	KStdKeyLetterJ,					(TStdScanCode) 'J',
   1.295 +	KStdKeyLetterK,					(TStdScanCode) 'K',
   1.296 +	KStdKeyLetterL,					(TStdScanCode) 'L',
   1.297 +	KStdKeyLetterM,					(TStdScanCode) 'M',
   1.298 +	KStdKeyLetterN,					(TStdScanCode) 'N',
   1.299 +	KStdKeyLetterO,					(TStdScanCode) 'O',
   1.300 +	KStdKeyLetterP,					(TStdScanCode) 'P',
   1.301 +	KStdKeyLetterQ,					(TStdScanCode) 'Q',
   1.302 +	KStdKeyLetterR,					(TStdScanCode) 'R',
   1.303 +	KStdKeyLetterS,					(TStdScanCode) 'S',
   1.304 +	KStdKeyLetterT,					(TStdScanCode) 'T',
   1.305 +	KStdKeyLetterU,					(TStdScanCode) 'U',
   1.306 +	KStdKeyLetterV,					(TStdScanCode) 'V',
   1.307 +	KStdKeyLetterW,					(TStdScanCode) 'W',
   1.308 +	KStdKeyLetterX,					(TStdScanCode) 'X',
   1.309 +	KStdKeyLetterY,					(TStdScanCode) 'Y',
   1.310 +	KStdKeyLetterZ,					(TStdScanCode) 'Z',
   1.311 +	KStdKeyAsterisk,				(TStdScanCode) '*',
   1.312 +	KStdKeyNull,					EStdKeyNull,
   1.313 +	KStdKeyBackspace,				EStdKeyBackspace,
   1.314 +	KStdKeyTab,						EStdKeyTab,
   1.315 +	KStdKeyEnter,					EStdKeyEnter,
   1.316 +	KStdKeyEscape,					EStdKeyEscape,
   1.317 +	KStdKeySpace,					EStdKeySpace,
   1.318 +	KStdKeyPrintScreen,				EStdKeyPrintScreen,
   1.319 +	KStdKeyPause,					EStdKeyPause,
   1.320 +	KStdKeyHome,					EStdKeyHome,
   1.321 +	KStdKeyEnd,						EStdKeyEnd,
   1.322 +	KStdKeyPageUp,					EStdKeyPageUp,
   1.323 +	KStdKeyPageDown,				EStdKeyPageDown,
   1.324 +	KStdKeyInsert,					EStdKeyInsert,
   1.325 +	KStdKeyDelete,					EStdKeyDelete,
   1.326 +	KStdKeyLeftArrow,				EStdKeyLeftArrow,
   1.327 +	KStdKeyRightArrow,				EStdKeyRightArrow,
   1.328 +	KStdKeyUpArrow,					EStdKeyUpArrow,
   1.329 +	KStdKeyDownArrow,				EStdKeyDownArrow,
   1.330 +	KStdKeyLeftShift,				EStdKeyLeftShift,
   1.331 +	KStdKeyRightShift,				EStdKeyRightShift,
   1.332 +	KStdKeyLeftAlt,					EStdKeyLeftAlt,
   1.333 +	KStdKeyRightAlt,				EStdKeyRightAlt,
   1.334 +	KStdKeyLeftCtrl,				EStdKeyLeftCtrl,
   1.335 +	KStdKeyRightCtrl,				EStdKeyRightCtrl,
   1.336 +	KStdKeyLeftFunc,				EStdKeyLeftFunc,
   1.337 +	KStdKeyRightFunc,				EStdKeyRightFunc,
   1.338 +	KStdKeyCapsLock,				EStdKeyCapsLock,
   1.339 +	KStdKeyNumLock,					EStdKeyNumLock,
   1.340 +	KStdKeyScrollLock,				EStdKeyScrollLock,
   1.341 +	KStdKeyF1,						EStdKeyF1,
   1.342 +	KStdKeyF2,						EStdKeyF2,
   1.343 +	KStdKeyF3,						EStdKeyF3,
   1.344 +	KStdKeyF4,						EStdKeyF4,
   1.345 +	KStdKeyF5,						EStdKeyF5,
   1.346 +	KStdKeyF6,						EStdKeyF6,
   1.347 +	KStdKeyF7,						EStdKeyF7,
   1.348 +	KStdKeyF8,						EStdKeyF8,
   1.349 +	KStdKeyF9,						EStdKeyF9,
   1.350 +	KStdKeyF10,						EStdKeyF10,
   1.351 +	KStdKeyF11,						EStdKeyF11,
   1.352 +	KStdKeyF12,						EStdKeyF12,
   1.353 +	KStdKeyF13,						EStdKeyF13,
   1.354 +	KStdKeyF14,						EStdKeyF14,
   1.355 +	KStdKeyF15,						EStdKeyF15,
   1.356 +	KStdKeyF16,						EStdKeyF16,
   1.357 +	KStdKeyF17,						EStdKeyF17,
   1.358 +	KStdKeyF18,						EStdKeyF18,
   1.359 +	KStdKeyF19,						EStdKeyF19,
   1.360 +	KStdKeyF20,						EStdKeyF20,
   1.361 +	KStdKeyF21,						EStdKeyF21,
   1.362 +	KStdKeyF22,						EStdKeyF22,
   1.363 +	KStdKeyF23,						EStdKeyF23,
   1.364 +	KStdKeyF24,						EStdKeyF24,
   1.365 +	KStdKeyXXX,						EStdKeyXXX,
   1.366 +	KStdKeyComma,					EStdKeyComma,
   1.367 +	KStdKeyFullStop,				EStdKeyFullStop,
   1.368 +	KStdKeyForwardSlash,			EStdKeyForwardSlash,
   1.369 +	KStdKeyBackSlash,				EStdKeyBackSlash,
   1.370 +	KStdKeySemiColon,				EStdKeySemiColon,
   1.371 +	KStdKeySingleQuote,				EStdKeySingleQuote,
   1.372 +	KStdKeyHash,					EStdKeyHash,
   1.373 +	KStdKeySquareBracketLeft,		EStdKeySquareBracketLeft,
   1.374 +	KStdKeySquareBracketRight,		EStdKeySquareBracketRight,
   1.375 +	KStdKeyMinus,					EStdKeyMinus,
   1.376 +	KStdKeyEquals,					EStdKeyEquals,
   1.377 +	KStdKeyNkpForwardSlash,			EStdKeyNkpForwardSlash,
   1.378 +	KStdKeyNkpAsterisk,				EStdKeyNkpAsterisk,
   1.379 +	KStdKeyNkpMinus,				EStdKeyNkpMinus,
   1.380 +	KStdKeyNkpPlus,					EStdKeyNkpPlus,
   1.381 +	KStdKeyNkpEnter,				EStdKeyNkpEnter,
   1.382 +	KStdKeyNkp1,					EStdKeyNkp1,
   1.383 +	KStdKeyNkp2,					EStdKeyNkp2,
   1.384 +	KStdKeyNkp3,					EStdKeyNkp3,
   1.385 +	KStdKeyNkp4,					EStdKeyNkp4,
   1.386 +	KStdKeyNkp5,					EStdKeyNkp5,
   1.387 +	KStdKeyNkp6,					EStdKeyNkp6,
   1.388 +	KStdKeyNkp7,					EStdKeyNkp7,
   1.389 +	KStdKeyNkp8,					EStdKeyNkp8,
   1.390 +	KStdKeyNkp9,					EStdKeyNkp9,
   1.391 +	KStdKeyNkp0,					EStdKeyNkp0,
   1.392 +	KStdKeyNkpFullStop,				EStdKeyNkpFullStop,
   1.393 +	KStdKeyMenu,					EStdKeyMenu,
   1.394 +	KStdKeyBacklightOn,				EStdKeyBacklightOn,
   1.395 +	KStdKeyBacklightOff,			EStdKeyBacklightOff,
   1.396 +	KStdKeyBacklightToggle,			EStdKeyBacklightToggle,
   1.397 +	KStdKeyIncContrast,				EStdKeyIncContrast,
   1.398 +	KStdKeyDecContrast,				EStdKeyDecContrast,
   1.399 +	KStdKeySliderDown,				EStdKeySliderDown,
   1.400 +	KStdKeySliderUp,				EStdKeySliderUp,
   1.401 +	KStdKeyDictaphonePlay,			EStdKeyDictaphonePlay,
   1.402 +	KStdKeyDictaphoneStop,			EStdKeyDictaphoneStop,
   1.403 +	KStdKeyDictaphoneRecord,		EStdKeyDictaphoneRecord,
   1.404 +	KStdKeyHelp,					EStdKeyHelp,
   1.405 +	KStdKeyOff,						EStdKeyOff,
   1.406 +	KStdKeyDial,					EStdKeyDial,
   1.407 +	KStdKeyIncVolume,				EStdKeyIncVolume,
   1.408 +	KStdKeyDecVolume,				EStdKeyDecVolume,
   1.409 +	KStdKeyDevice0,					EStdKeyDevice0,
   1.410 +	KStdKeyDevice1,					EStdKeyDevice1,
   1.411 +	KStdKeyDevice2,					EStdKeyDevice2,
   1.412 +	KStdKeyDevice3,					EStdKeyDevice3,
   1.413 +	KStdKeyDevice4,					EStdKeyDevice4,
   1.414 +	KStdKeyDevice5,					EStdKeyDevice5,
   1.415 +	KStdKeyDevice6,					EStdKeyDevice6,
   1.416 +	KStdKeyDevice7,					EStdKeyDevice7,
   1.417 +	KStdKeyDevice8,					EStdKeyDevice8,
   1.418 +	KStdKeyDevice9,					EStdKeyDevice9,
   1.419 +	KStdKeyDeviceA,					EStdKeyDeviceA,
   1.420 +	KStdKeyDeviceB,					EStdKeyDeviceB,
   1.421 +	KStdKeyDeviceC,					EStdKeyDeviceC,
   1.422 +	KStdKeyDeviceD,					EStdKeyDeviceD,
   1.423 +	KStdKeyDeviceE,					EStdKeyDeviceE,
   1.424 +	KStdKeyDeviceF,					EStdKeyDeviceF,
   1.425 +	KStdKeyApplication0,			EStdKeyApplication0,
   1.426 +	KStdKeyApplication1,			EStdKeyApplication1,
   1.427 +	KStdKeyApplication2,			EStdKeyApplication2,
   1.428 +	KStdKeyApplication3,			EStdKeyApplication3,
   1.429 +	KStdKeyApplication4,			EStdKeyApplication4,
   1.430 +	KStdKeyApplication5,			EStdKeyApplication5,
   1.431 +	KStdKeyApplication6,			EStdKeyApplication6,
   1.432 +	KStdKeyApplication7,			EStdKeyApplication7,
   1.433 +	KStdKeyApplication8,			EStdKeyApplication8,
   1.434 +	KStdKeyApplication9,			EStdKeyApplication9,
   1.435 +	KStdKeyApplicationA,			EStdKeyApplicationA,
   1.436 +	KStdKeyApplicationB,			EStdKeyApplicationB,
   1.437 +	KStdKeyApplicationC,			EStdKeyApplicationC,
   1.438 +	KStdKeyApplicationD,			EStdKeyApplicationD,
   1.439 +	KStdKeyApplicationE,			EStdKeyApplicationE,
   1.440 +	KStdKeyApplicationF,			EStdKeyApplicationF,
   1.441 +	KStdKeyYes,						EStdKeyYes,
   1.442 +	KStdKeyNo,						EStdKeyNo,
   1.443 +	KStdKeyIncBrightness,			EStdKeyIncBrightness,
   1.444 +	KStdKeyDecBrightness,			EStdKeyDecBrightness,
   1.445 +	KStdKeyKeyboardExtend,			EStdKeyKeyboardExtend,
   1.446 +	KStdKeyDevice10,				EStdKeyDevice10,
   1.447 +	KStdKeyDevice11,				EStdKeyDevice11,
   1.448 +	KStdKeyDevice12,				EStdKeyDevice12,
   1.449 +	KStdKeyDevice13,				EStdKeyDevice13,
   1.450 +	KStdKeyDevice14,				EStdKeyDevice14,
   1.451 +	KStdKeyDevice15,				EStdKeyDevice15,
   1.452 +	KStdKeyDevice16,				EStdKeyDevice16,
   1.453 +	KStdKeyDevice17,				EStdKeyDevice17,
   1.454 +	KStdKeyDevice18,				EStdKeyDevice18,
   1.455 +	KStdKeyDevice19,				EStdKeyDevice19,
   1.456 +	KStdKeyDevice1A,				EStdKeyDevice1A,
   1.457 +	KStdKeyDevice1B,				EStdKeyDevice1B,
   1.458 +	KStdKeyDevice1C,				EStdKeyDevice1C,
   1.459 +	KStdKeyDevice1D,				EStdKeyDevice1D,
   1.460 +	KStdKeyDevice1E,				EStdKeyDevice1E,
   1.461 +	KStdKeyDevice1F,				EStdKeyDevice1F,
   1.462 +	KStdKeyApplication10,			EStdKeyApplication10,
   1.463 +	KStdKeyApplication11,			EStdKeyApplication11,
   1.464 +	KStdKeyApplication12,			EStdKeyApplication12,
   1.465 +	KStdKeyApplication13,			EStdKeyApplication13,
   1.466 +	KStdKeyApplication14,			EStdKeyApplication14,
   1.467 +	KStdKeyApplication15,			EStdKeyApplication15,
   1.468 +	KStdKeyApplication16,			EStdKeyApplication16,
   1.469 +	KStdKeyApplication17,			EStdKeyApplication17,
   1.470 +	KStdKeyApplication18,			EStdKeyApplication18,
   1.471 +	KStdKeyApplication19,			EStdKeyApplication19,
   1.472 +	KStdKeyApplication1A,			EStdKeyApplication1A,
   1.473 +	KStdKeyApplication1B,			EStdKeyApplication1B,
   1.474 +	KStdKeyApplication1C,			EStdKeyApplication1C,
   1.475 +	KStdKeyApplication1D,			EStdKeyApplication1D,
   1.476 +	KStdKeyApplication1E,			EStdKeyApplication1E,
   1.477 +	KStdKeyApplication1F,			EStdKeyApplication1F,
   1.478 +	KStdKeyDevice20,				EStdKeyDevice20,
   1.479 +	KStdKeyDevice21,				EStdKeyDevice21,
   1.480 +	KStdKeyDevice22,				EStdKeyDevice22,
   1.481 +	KStdKeyDevice23,				EStdKeyDevice23,
   1.482 +	KStdKeyDevice24,				EStdKeyDevice24,
   1.483 +	KStdKeyDevice25,				EStdKeyDevice25,
   1.484 +	KStdKeyDevice26,				EStdKeyDevice26,
   1.485 +	KStdKeyDevice27,				EStdKeyDevice27,
   1.486 +	KStdKeyApplication20,			EStdKeyApplication20,
   1.487 +	KStdKeyApplication21,			EStdKeyApplication21,
   1.488 +	KStdKeyApplication22,			EStdKeyApplication22,
   1.489 +	KStdKeyApplication23,			EStdKeyApplication23,
   1.490 +	KStdKeyApplication24,			EStdKeyApplication24,
   1.491 +	KStdKeyApplication25,			EStdKeyApplication25,
   1.492 +	KStdKeyApplication26,			EStdKeyApplication26,
   1.493 +	KStdKeyApplication27,			EStdKeyApplication27,
   1.494 +	KEnumNull,						(TStdScanCode) -1
   1.495 +	};
   1.496 +
   1.497 +_LIT(KEnumCoverageVeryLow,			"VeryLow");
   1.498 +_LIT(KEnumCoverageLow,				"Low");
   1.499 +_LIT(KEnumCoverageMedium,			"Medium");
   1.500 +_LIT(KEnumCoverageFull,				"Full");
   1.501 +const CDataWrapperBase::TEnumEntryTable	CT_KeypadDriverData::iEnumTableCoverage[] =
   1.502 +	{
   1.503 +	KEnumCoverageVeryLow,			8,
   1.504 +	KEnumCoverageLow,				4,
   1.505 +	KEnumCoverageMedium,			2,
   1.506 +	KEnumCoverageFull,				1,
   1.507 +	KEnumNull,						-1
   1.508 +	};
   1.509 +
   1.510 +_LIT(KEnumKeyboardState,					"EKeyboardState");
   1.511 +_LIT(KEnumKeyboard,							"EKeyboard");
   1.512 +_LIT(KEnumKeyboardDeviceKeys,				"EKeyboardDeviceKeys");
   1.513 +_LIT(KEnumKeyboardAppKeys,					"EKeyboardAppKeys");
   1.514 +_LIT(KEnumKeyboardClick,					"EKeyboardClick");
   1.515 +_LIT(KEnumKeyboardClickVolumeMax,			"EKeyboardClickVolumeMax");
   1.516 +_LIT(KEnumKeyboardClickState,				"EKeyboardClickState");
   1.517 +_LIT(KEnumKeyboardClickVolume,				"EKeyboardClickVolume");
   1.518 +const CT_HALData::THalTableLookup	CT_KeypadDriverData::iTableLookup[] =
   1.519 +	{
   1.520 +//	Enum as a descriptor			Enum								Prepare input	Prepare				Validation of		Store data returned after a		Flag indicating
   1.521 +//																		value prior to	parameters			value returned		successful HAL::Get or			if validation
   1.522 +//																		HAL::Set call	prior to 			after a successful	HAL::Set call					is mandatory
   1.523 +//																						HAL::Get call		HAL::Get call
   1.524 +	KEnumKeyboardState,				HALData::EKeyboardState,			SetPrepareInt,	GetPrepareNothing,	GetValidationInt,	SetKeyboardState,				ETrue,
   1.525 +	KEnumKeyboard,					HALData::EKeyboard,					SetPrepareInt,	GetPrepareNothing,	GetValidationInt,	SetKeyboard,					ETrue,
   1.526 +	KEnumKeyboardDeviceKeys,		HALData::EKeyboardDeviceKeys,		SetPrepareInt,	GetPrepareNothing,	GetValidationInt,	SetKeyboardDeviceKeys,			ETrue,
   1.527 +	KEnumKeyboardAppKeys,			HALData::EKeyboardAppKeys,			SetPrepareInt,	GetPrepareNothing,	GetValidationInt,	SetKeyboardAppKeys,				ETrue,
   1.528 +	KEnumKeyboardClick,				HALData::EKeyboardClick,			SetPrepareInt,	GetPrepareNothing,	GetValidationInt,	SetKeyboardClick,				ETrue,
   1.529 +	KEnumKeyboardClickVolumeMax,	HALData::EKeyboardClickVolumeMax,	SetPrepareInt,	GetPrepareNothing,	GetValidationInt,	SetKeyboardClickVolumeMax,		ETrue,
   1.530 +	KEnumKeyboardClickState,		HALData::EKeyboardClickState,		SetPrepareInt,	GetPrepareNothing,	GetValidationInt,	SetKeyboardClickState,			ETrue,
   1.531 +	KEnumKeyboardClickVolume,		HALData::EKeyboardClickVolume,		SetPrepareInt,	GetPrepareNothing,	GetValidationInt,	SetKeyboardClickVolume,			ETrue,
   1.532 +	KEnumNull,						(HALData::TAttribute)0,				NULL,			NULL,				NULL,				NULL,							NULL
   1.533 +	};
   1.534 +
   1.535 +//////////////////////////////////////////////////////////////////////
   1.536 +// Construction/Destruction
   1.537 +//////////////////////////////////////////////////////////////////////
   1.538 +
   1.539 +CT_KeypadDriverData* CT_KeypadDriverData::NewL()
   1.540 +	{
   1.541 +	CT_KeypadDriverData*	ret=new (ELeave) CT_KeypadDriverData();
   1.542 +	CleanupStack::PushL(ret);
   1.543 +	ret->ConstructL();
   1.544 +	CleanupStack::Pop(ret);
   1.545 +	return ret;
   1.546 +	}
   1.547 +
   1.548 +
   1.549 +CT_KeypadDriverData::CT_KeypadDriverData()
   1.550 +:	CT_HALData(iTableLookup)
   1.551 +,	iKeyboardState(-1)
   1.552 +,	iKeyboard(-1)
   1.553 +,	iKeyboardDeviceKeys(-1)
   1.554 +,	iKeyboardAppKeys(-1)
   1.555 +,	iKeyboardClick(-1)
   1.556 +,	iKeyboardClickVolumeMax(-1)
   1.557 +,	iKeyboardClickState(-1)
   1.558 +,	iKeyboardClickVolume(-1)
   1.559 +,	iActiveKey(NULL)
   1.560 +,	iActiveCombination(NULL)
   1.561 +,	iActiveKeypadState(NULL)
   1.562 +,	iActivePrompt(NULL)
   1.563 +,	iExpectedState(0)
   1.564 +,	iKeyCount(0)
   1.565 +,	iCombinationCount(0)
   1.566 +,	iCombinationKeyCount(0)
   1.567 +,	iFailTest(EFalse)
   1.568 +,	iPassKey(0)
   1.569 +	{
   1.570 +	}
   1.571 +
   1.572 +void CT_KeypadDriverData::ConstructL()
   1.573 +/**
   1.574 + * Second phase construction
   1.575 + *
   1.576 + * @internalComponent
   1.577 + *
   1.578 + * @return	N/A
   1.579 + *
   1.580 + * @pre		None
   1.581 + * @post	None
   1.582 + *
   1.583 + * @leave	system wide error
   1.584 + */
   1.585 +	{
   1.586 +	iActiveKey 				= CActiveCallback::NewL(*this);
   1.587 +	iActiveCombination		= CActiveCallback::NewL(*this);
   1.588 +	iActiveKeypadState		= CActiveCallbackBase::NewL(*this);
   1.589 +	iActivePrompt			= CActiveCallback::NewL(*this);
   1.590 +
   1.591 +	User::LeaveIfError(iConsole.Init(KConsoleName,TSize(KConsFullScreen,KConsFullScreen)));
   1.592 +	User::LeaveIfError(iConsole.Control(KMaximized));
   1.593 +	User::LeaveIfError(iConsole.Control(KRawEventMode));
   1.594 +
   1.595 +	iEventStore.AppendL(TRawEvent::EKeyDown);
   1.596 +	iEventStore.AppendL(TRawEvent::EKeyUp);
   1.597 +	}
   1.598 +
   1.599 +CT_KeypadDriverData::~CT_KeypadDriverData()
   1.600 +/**
   1.601 + * Public destructor
   1.602 + */
   1.603 +	{
   1.604 +	iConsole.Control(KRawEventModeOff);
   1.605 +	iConsole.Destroy();
   1.606 +
   1.607 +	iPossibleScanCodeStrStore.Reset();
   1.608 +	iPossibleScanCodeStrStore.Close();
   1.609 +	iPossibleScanCodeStore.Reset();
   1.610 +	iPossibleScanCodeStore.Close();
   1.611 +	iPossibleModifierStrStore.Reset();
   1.612 +	iPossibleModifierStrStore.Close();
   1.613 +	iPossibleModifierStore.Reset();
   1.614 +	iPossibleModifierStore.Close();
   1.615 +	iAllPossibleKeysStrStore.Reset();
   1.616 +	iAllPossibleKeysStrStore.Close();
   1.617 +	iAllPossibleKeysStore.Reset();
   1.618 +	iAllPossibleKeysStore.Close();
   1.619 +	iCombinationStrStore.Reset();
   1.620 +	iCombinationStrStore.Close();
   1.621 +	iExpectedStore.Reset();
   1.622 +	iExpectedStore.Close();
   1.623 +	iActualStore.Reset();
   1.624 +	iActualStore.Close();
   1.625 +	iEventStore.Reset();
   1.626 +	iEventStore.Close();
   1.627 +
   1.628 +	delete iActiveKey;
   1.629 +	delete iActiveCombination;
   1.630 +	delete iActiveKeypadState;
   1.631 +	delete iActivePrompt;
   1.632 +	}
   1.633 +
   1.634 +TAny* CT_KeypadDriverData::GetObject()
   1.635 +/**
   1.636 + * Return a pointer to the object that the data wraps
   1.637 + *
   1.638 + * @return	pointer to the object that the data wraps
   1.639 + */
   1.640 +	{
   1.641 +	return NULL;
   1.642 +	}
   1.643 +
   1.644 +//	An empty function to ensure that the code will work fine with HAL_Data
   1.645 +TBool CT_KeypadDriverData::GetPrepareNothing(CDataWrapperBase* /*aThis*/, const TDesC& /*aSection*/, TInt& /*aValueStart*/, TInt& /*aValueEnd*/)
   1.646 +	{
   1.647 +	return ETrue;
   1.648 +	}
   1.649 +
   1.650 +//	Store the keypad state
   1.651 +void CT_KeypadDriverData::SetKeyboardState(CDataWrapperBase* aThis, TInt aValue)
   1.652 +	{
   1.653 +	static_cast<CT_KeypadDriverData*>(aThis)->iKeyboardState=aValue;
   1.654 +	}
   1.655 +
   1.656 +//	Store the keypad type
   1.657 +void CT_KeypadDriverData::SetKeyboard(CDataWrapperBase* aThis, TInt aValue)
   1.658 +	{
   1.659 +	static_cast<CT_KeypadDriverData*>(aThis)->iKeyboard=aValue;
   1.660 +	}
   1.661 +
   1.662 +//	Store the amount of keypad device keys
   1.663 +void CT_KeypadDriverData::SetKeyboardDeviceKeys(CDataWrapperBase* aThis, TInt aValue)
   1.664 +	{
   1.665 +	static_cast<CT_KeypadDriverData*>(aThis)->iKeyboardDeviceKeys=aValue;
   1.666 +	}
   1.667 +
   1.668 +//	Store the amount of keypad app keys
   1.669 +void CT_KeypadDriverData::SetKeyboardAppKeys(CDataWrapperBase* aThis, TInt aValue)
   1.670 +	{
   1.671 +	static_cast<CT_KeypadDriverData*>(aThis)->iKeyboardAppKeys=aValue;
   1.672 +	}
   1.673 +
   1.674 +//	Store the keypad click indicator
   1.675 +void CT_KeypadDriverData::SetKeyboardClick(CDataWrapperBase* aThis, TInt aValue)
   1.676 +	{
   1.677 +	static_cast<CT_KeypadDriverData*>(aThis)->iKeyboardClick=aValue;
   1.678 +	}
   1.679 +
   1.680 +//	Store the keypad max click volume
   1.681 +void CT_KeypadDriverData::SetKeyboardClickVolumeMax(CDataWrapperBase* aThis, TInt aValue)
   1.682 +	{
   1.683 +	static_cast<CT_KeypadDriverData*>(aThis)->iKeyboardClickVolumeMax=aValue;
   1.684 +	}
   1.685 +
   1.686 +//	Store the keypad click state
   1.687 +void CT_KeypadDriverData::SetKeyboardClickState(CDataWrapperBase* aThis, TInt aValue)
   1.688 +	{
   1.689 +	static_cast<CT_KeypadDriverData*>(aThis)->iKeyboardClickState=aValue;
   1.690 +	}
   1.691 +
   1.692 +//	Store the keypad click volume
   1.693 +void CT_KeypadDriverData::SetKeyboardClickVolume(CDataWrapperBase* aThis, TInt aValue)
   1.694 +	{
   1.695 +	static_cast<CT_KeypadDriverData*>(aThis)->iKeyboardClickVolume=aValue;
   1.696 +	}
   1.697 +
   1.698 +TBool CT_KeypadDriverData::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
   1.699 +/**
   1.700 + * Process a command read from the ini file
   1.701 + *
   1.702 + * @param aCommand			The command to process
   1.703 + * @param aSection			The section in the ini containing data for the command
   1.704 + * @param aAsyncErrorIndex	Command index for async calls to return errors to
   1.705 + *
   1.706 + * @return					ETrue if the command is processed
   1.707 + *
   1.708 + * @leave					System wide error
   1.709 + */
   1.710 +	{
   1.711 +	TBool	ret = ETrue;
   1.712 +
   1.713 +	if ( aCommand == KGetScanCodes )
   1.714 +		{
   1.715 +		DoCmdGetScanCodesL(aSection);
   1.716 +		}
   1.717 +	else if ( aCommand == KGetModifiers )
   1.718 +		{
   1.719 +		DoCmdGetModifiersL(aSection);
   1.720 +		}
   1.721 +	else if ( aCommand == KTestAllKeys )
   1.722 +		{
   1.723 +		DoCmdTestAllKeysL(aAsyncErrorIndex);
   1.724 +		}
   1.725 +	else if ( aCommand == KTestOneModifierOneOtherKey )
   1.726 +		{
   1.727 +		DoCmdTestOneModifierOneOtherKeyL(aSection, aAsyncErrorIndex);
   1.728 +		}
   1.729 +	else if ( aCommand == KTestTwoKeys )
   1.730 +		{
   1.731 +		DoCmdTestTwoKeysL(aSection, aAsyncErrorIndex);
   1.732 +		}
   1.733 +	else if ( aCommand == KTestMultipleKeys )
   1.734 +		{
   1.735 +		DoCmdTestMultipleKeysL(aSection, aAsyncErrorIndex);
   1.736 +		}
   1.737 +	else if ( aCommand == KVerifyKeypadState )
   1.738 +		{
   1.739 +		DoCmdVerifyKeypadState(aSection, aAsyncErrorIndex);
   1.740 +		}
   1.741 +	else if ( aCommand == KPromptUser )
   1.742 +		{
   1.743 +		DoCmdPromptUser(aSection, aAsyncErrorIndex);
   1.744 +		}
   1.745 +	else
   1.746 +		{
   1.747 +		ret = CT_HALData::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
   1.748 +		}
   1.749 +
   1.750 +	return ret;
   1.751 +	}
   1.752 +
   1.753 +
   1.754 +void CT_KeypadDriverData::DoCmdGetScanCodesL(const TDesC& aSection)
   1.755 +/**
   1.756 + * Get the scancodes of the platform
   1.757 + *
   1.758 + * @param aSection			The section in the ini containing data for the command
   1.759 + *
   1.760 + * @return					void
   1.761 + *
   1.762 + * @leave					System wide error
   1.763 + */
   1.764 +	{
   1.765 +	iPossibleScanCodeStrStore.Reset();
   1.766 +	iPossibleScanCodeStore.Reset();
   1.767 +	iAllPossibleKeysStrStore.Reset();
   1.768 +	iAllPossibleKeysStore.Reset();
   1.769 +
   1.770 +	TIniDataName	tempStore;
   1.771 +	TPtrC			scanCodeStr;
   1.772 +	TPtrC			scanCodeName;
   1.773 +	TInt		 	scanCode;
   1.774 +
   1.775 +	TInt	index=0;
   1.776 +	TBool	moreData=ETrue;
   1.777 +	while ( moreData )
   1.778 +		{
   1.779 +		++index;
   1.780 +		tempStore.Format(KScanCodeString(), index);
   1.781 +		moreData=GetStringFromConfig(aSection, tempStore, scanCodeStr);
   1.782 +		if ( moreData )
   1.783 +			{
   1.784 +			tempStore.Format(KScanCode(), index);
   1.785 +			if (!GetEnumFromConfig(aSection, tempStore, iEnumTableScanCodes, scanCode))
   1.786 +				{
   1.787 +				ERR_PRINTF2(_L("Invalid scancode value: %d"), scanCode);
   1.788 +				SetBlockResult(EFail);
   1.789 +				}
   1.790 +			else
   1.791 +				{
   1.792 +				iPossibleScanCodeStrStore.AppendL(scanCodeStr);
   1.793 +				iPossibleScanCodeStore.AppendL(scanCode);
   1.794 +
   1.795 +				iAllPossibleKeysStrStore.AppendL(scanCodeStr);
   1.796 +				iAllPossibleKeysStore.AppendL(scanCode);
   1.797 +				}
   1.798 +			}
   1.799 +		}
   1.800 +	}
   1.801 +
   1.802 +void CT_KeypadDriverData::DoCmdGetModifiersL(const TDesC& aSection)
   1.803 +/**
   1.804 + * Get the modifiers of the platform
   1.805 + *
   1.806 + * @param aSection			The section in the ini containing data for the command
   1.807 + *
   1.808 + * @return					void
   1.809 + *
   1.810 + * @leave					System wide error
   1.811 + */
   1.812 +	{
   1.813 +	iPossibleModifierStrStore.Reset();
   1.814 +	iPossibleModifierStore.Reset();
   1.815 +
   1.816 +	TIniDataName	tempStore;
   1.817 +	TPtrC			modifierStr;
   1.818 +	TInt			modifier;
   1.819 +
   1.820 +	TInt	index=0;
   1.821 +	TBool	moreData=ETrue;
   1.822 +	while ( moreData )
   1.823 +		{
   1.824 +		++index;
   1.825 +		tempStore.Format(KModifierString(), index);
   1.826 +		moreData=GetStringFromConfig(aSection, tempStore, modifierStr);
   1.827 +		if ( moreData )
   1.828 +			{
   1.829 +			tempStore.Format(KModifier(), index);
   1.830 +			if (!GetEnumFromConfig(aSection, tempStore, iEnumTableScanCodes, modifier))
   1.831 +				{
   1.832 +				ERR_PRINTF2(_L("Invalid modifier value: %d"), modifier);
   1.833 +				SetBlockResult(EFail);
   1.834 +				}
   1.835 +			else
   1.836 +				{
   1.837 +				iPossibleModifierStrStore.AppendL(modifierStr);
   1.838 +				iPossibleModifierStore.AppendL(modifier);
   1.839 +
   1.840 +				iAllPossibleKeysStrStore.AppendL(modifierStr);
   1.841 +				iAllPossibleKeysStore.AppendL(modifier);
   1.842 +				}
   1.843 +			}
   1.844 +		}
   1.845 +	}
   1.846 +
   1.847 +void CT_KeypadDriverData::DoCmdTestAllKeysL(const TInt aAsyncErrorIndex)
   1.848 +/**
   1.849 + * Tests one key at the time by verifying the actual scancode against expected value
   1.850 + *
   1.851 + * @param aSection			The section in the ini containing data for the command
   1.852 + *
   1.853 + * @return					void
   1.854 + *
   1.855 + * @leave					System wide error
   1.856 + */
   1.857 +	{
   1.858 +	iExpectedStore.Reset();
   1.859 +	iActualStore.Reset();
   1.860 +	iConsole.ClearScreen();
   1.861 +
   1.862 +	iKeyCount=0;
   1.863 +	for ( TInt key=0; key<iAllPossibleKeysStore.Count(); ++key )
   1.864 +		{
   1.865 +		for ( TInt event=0; event<iEventStore.Count(); ++event )
   1.866 +			{
   1.867 +			iExpectedStore.AppendL(iEventStore[event]);
   1.868 +			iExpectedStore.AppendL(iAllPossibleKeysStore[key]);
   1.869 +			}
   1.870 +		}
   1.871 +
   1.872 +	//end of setup and start testcase
   1.873 +	iConsole.Write(_L("Keyboard layout test.\n"));
   1.874 +	iConsole.Write(_L("Press the key corresponding to the "));
   1.875 +
   1.876 +	iConsole.Write(iAllPossibleKeysStrStore[iKeyCount]);
   1.877 +
   1.878 +	iConsole.Read(iKey, iActiveKey->iStatus);
   1.879 +	iActiveKey->Activate( aAsyncErrorIndex );
   1.880 +	IncOutstanding(); 	// request an event
   1.881 +	}
   1.882 +
   1.883 +
   1.884 +void CT_KeypadDriverData::DoCmdTestOneModifierOneOtherKeyL(const TDesC& aSection, const TInt aAsyncErrorIndex)
   1.885 +/**
   1.886 + * Tests one modifier + key combinations by verifying their scancodes against expected values
   1.887 + *
   1.888 + * @param aSection			The section in the ini containing data for the command
   1.889 + *
   1.890 + * @return					void
   1.891 + *
   1.892 + * @leave					System wide error
   1.893 + */
   1.894 +	{
   1.895 +	iCombinationStrStore.Reset();
   1.896 +	iExpectedStore.Reset();
   1.897 +	iActualStore.Reset();
   1.898 +	iConsole.ClearScreen();
   1.899 +	iCombinationCount  	 = 0;
   1.900 +	iCombinationKeyCount = 0;
   1.901 +
   1.902 +	TInt	divider 	 = 1;
   1.903 +	TBool	dataOk=GetEnumFromConfig(aSection, KTestCoverage, iEnumTableCoverage, divider);
   1.904 +	if ( !dataOk )
   1.905 +		{
   1.906 +		ERR_PRINTF2(KLogMissingParameter, &KTestCoverage());
   1.907 +		SetBlockResult(EFail);
   1.908 +		}
   1.909 +	else
   1.910 +		{
   1.911 +		TInt	modifierCount 	= iPossibleModifierStore.Count();
   1.912 +		TInt	keyCount	  	= (TInt)(iPossibleScanCodeStore.Count() / divider);
   1.913 +
   1.914 +		if (divider != 1)
   1.915 +			{
   1.916 +			++keyCount;
   1.917 +			}
   1.918 +
   1.919 +		for ( TInt key=0; key<keyCount; ++key )
   1.920 +			{
   1.921 +			for ( TInt modifier=0; modifier<modifierCount; ++modifier )
   1.922 +				{
   1.923 +				for ( TInt event=0; event<iEventStore.Count(); ++event )
   1.924 +					{
   1.925 +					iExpectedStore.AppendL(iEventStore[event]);
   1.926 +					iExpectedStore.AppendL(iPossibleModifierStore[modifier]);
   1.927 +					iExpectedStore.AppendL(iEventStore[event]);
   1.928 +					iExpectedStore.AppendL(iPossibleScanCodeStore[key]);
   1.929 +					}
   1.930 +
   1.931 +				TIniDataName	tempStrArray;
   1.932 +				tempStrArray.Append(iPossibleModifierStrStore[modifier]);
   1.933 +				tempStrArray.Append(_L(" + "));
   1.934 +				tempStrArray.Append(iPossibleScanCodeStrStore[key]);
   1.935 +				iCombinationStrStore.Append(tempStrArray);
   1.936 +				}
   1.937 +			}
   1.938 +
   1.939 +		if ( iExpectedStore.Count()>0 )
   1.940 +			{//end of setup and start testcase
   1.941 +			iConsole.Write(_L("Keyboard layout test.\n"));
   1.942 +			iConsole.Write(_L("Press the following keys in the sequence as displayed:\n"));
   1.943 +			iConsole.Write(iCombinationStrStore[iCombinationCount]);
   1.944 +			iConsole.Write(_L("\n"));
   1.945 +			iConsole.Write(_L("and release them in the same sequence."));
   1.946 +
   1.947 +			iConsole.Read(iKey, iActiveCombination->iStatus);
   1.948 +			iActiveCombination->Activate( aAsyncErrorIndex );
   1.949 +			IncOutstanding(); 	// request an event*/
   1.950 +			}
   1.951 +		else
   1.952 +			{
   1.953 +			INFO_PRINTF1(_L("No modifiers and/or keys available or too small test coverage set"));
   1.954 +			}
   1.955 +		}
   1.956 +	}
   1.957 +
   1.958 +void CT_KeypadDriverData::DoCmdTestTwoKeysL(const TDesC& aSection, const TInt aAsyncErrorIndex)
   1.959 +/**
   1.960 + * Tests key + key combinations by verifying their scancodes against expected values
   1.961 + *
   1.962 + * @param aSection			The section in the ini containing data for the command
   1.963 + *
   1.964 + * @return					void
   1.965 + *
   1.966 + * @leave					System wide error
   1.967 + */
   1.968 + 	{
   1.969 +	iCombinationStrStore.Reset();
   1.970 +	iExpectedStore.Reset();
   1.971 +	iActualStore.Reset();
   1.972 +	iConsole.ClearScreen();
   1.973 +	iCombinationCount		= 0;
   1.974 +	iCombinationKeyCount	= 0;
   1.975 +
   1.976 +	TInt	divider			= 1;
   1.977 +	TBool	dataOk=GetEnumFromConfig(aSection, KTestCoverage, iEnumTableCoverage, divider);
   1.978 +	if ( !dataOk )
   1.979 +		{
   1.980 +		ERR_PRINTF2(KLogMissingParameter, &KTestCoverage());
   1.981 +		SetBlockResult(EFail);
   1.982 +		}
   1.983 +	else
   1.984 +		{
   1.985 +		TInt	keyCount=(TInt)(iPossibleScanCodeStore.Count() / divider);
   1.986 +
   1.987 +		if (divider != 1)
   1.988 +			{
   1.989 +			++keyCount;
   1.990 +			}
   1.991 +
   1.992 +		for ( TInt key1=0; key1<keyCount; ++key1 )
   1.993 +			{
   1.994 +			for ( TInt key2= 0; key2<keyCount; ++key2 )
   1.995 +				{
   1.996 +				if ( iPossibleScanCodeStore[key1]!=iPossibleScanCodeStore[key2] )
   1.997 +					{
   1.998 +					for ( TInt event=0; event<iEventStore.Count(); ++event )
   1.999 +						{
  1.1000 +						iExpectedStore.AppendL(iEventStore[event]);
  1.1001 +						iExpectedStore.AppendL(iPossibleScanCodeStore[key1]);
  1.1002 +						iExpectedStore.AppendL(iEventStore[event]);
  1.1003 +						iExpectedStore.AppendL(iPossibleScanCodeStore[key2]);
  1.1004 +						}
  1.1005 +
  1.1006 +					TIniDataName	tempStrArray;
  1.1007 +					tempStrArray.Append(iPossibleScanCodeStrStore[key1]);
  1.1008 +					tempStrArray.Append(_L(" + "));
  1.1009 +					tempStrArray.Append(iPossibleScanCodeStrStore[key2]);
  1.1010 +					iCombinationStrStore.Append(tempStrArray);
  1.1011 +					}
  1.1012 +				}
  1.1013 +			}
  1.1014 +
  1.1015 +		if ( iExpectedStore.Count()>0 )
  1.1016 +			{//end of setup and start testcase
  1.1017 +			iConsole.Write(_L("Keyboard layout test.\n"));
  1.1018 +			iConsole.Write(_L("Press the following keys in the sequence as displayed:\n"));
  1.1019 +			iConsole.Write(iCombinationStrStore[iCombinationCount]);
  1.1020 +			iConsole.Write(_L("\n"));
  1.1021 +			iConsole.Write(_L("and release them in the same sequence."));
  1.1022 +
  1.1023 +			iConsole.Read(iKey, iActiveCombination->iStatus);
  1.1024 +			iActiveCombination->Activate( aAsyncErrorIndex );
  1.1025 +			IncOutstanding(); 	// request an event*/
  1.1026 +			}
  1.1027 +		else
  1.1028 +			{
  1.1029 +			INFO_PRINTF1(_L("No keys available or too small test coverage set"));
  1.1030 +			}
  1.1031 +		}
  1.1032 +	}
  1.1033 +
  1.1034 +void CT_KeypadDriverData::DoCmdTestMultipleKeysL(const TDesC& aSection, const TInt aAsyncErrorIndex)
  1.1035 +/**
  1.1036 + * Tests multiple key combinations by verifying their scancodes against expected values
  1.1037 + *
  1.1038 + * @param aSection			The section in the ini containing data for the command
  1.1039 + *
  1.1040 + * @return					void
  1.1041 + *
  1.1042 + * @leave					System wide error
  1.1043 + */
  1.1044 + 	{
  1.1045 +	iCombinationStrStore.Reset();
  1.1046 +	iExpectedStore.Reset();
  1.1047 +	iActualStore.Reset();
  1.1048 +	iCombinationKeyCount = 0;
  1.1049 +	iConsole.ClearScreen();
  1.1050 +
  1.1051 +	RArray<TInt>	keyStore;
  1.1052 +	RArray<TPtrC>	keyStrStore;
  1.1053 +
  1.1054 +	keyStore.Reset();
  1.1055 +	keyStrStore.Reset();
  1.1056 +
  1.1057 +	TIniDataName	setStore;
  1.1058 +	TIniDataName	strStore;
  1.1059 +	TIniDataName	fullStore;
  1.1060 +	TPtrC			scanCodeStr;
  1.1061 +	TInt			scanCode;
  1.1062 +
  1.1063 +	TInt	setIndex=0;
  1.1064 +	TBool	moreSets=ETrue;
  1.1065 +	while ( moreSets )
  1.1066 +		{
  1.1067 +		++setIndex;
  1.1068 +
  1.1069 +		keyStore.Reset();
  1.1070 +		keyStrStore.Reset();
  1.1071 +
  1.1072 +		setStore.Format(KSet(), setIndex);
  1.1073 +		setStore.Append(_L("_"));
  1.1074 +
  1.1075 +		TInt	index	=0;
  1.1076 +		TBool	moreData=ETrue;
  1.1077 +		while ( moreData )
  1.1078 +			{
  1.1079 +			++index;
  1.1080 +
  1.1081 +			fullStore 	= _L("");
  1.1082 +			strStore.Format(KScanCodeString(), index);
  1.1083 +			fullStore.Append(setStore);
  1.1084 +			fullStore.Append(strStore);
  1.1085 +
  1.1086 +			moreData=GetStringFromConfig(aSection, fullStore, scanCodeStr);
  1.1087 +			if ( moreData )
  1.1088 +				{
  1.1089 +				fullStore = _L("");
  1.1090 +				strStore.Format(KScanCode(), index);
  1.1091 +				fullStore.Append(setStore);
  1.1092 +				fullStore.Append(strStore);
  1.1093 +
  1.1094 +				if (!GetEnumFromConfig(aSection, fullStore, iEnumTableScanCodes, scanCode))
  1.1095 +					{
  1.1096 +					ERR_PRINTF2(_L("Invalid scancode value: %d"), scanCode);
  1.1097 +					SetBlockResult(EFail);
  1.1098 +					}
  1.1099 +				else
  1.1100 +					{
  1.1101 +					keyStrStore.AppendL(scanCodeStr);
  1.1102 +					keyStore.AppendL(scanCode);
  1.1103 +					}
  1.1104 +				++index;
  1.1105 +				}
  1.1106 +			else
  1.1107 +				{
  1.1108 +				if (index == 1)
  1.1109 +					{
  1.1110 +					moreSets = EFalse;
  1.1111 +					}
  1.1112 +				}
  1.1113 +			}
  1.1114 +
  1.1115 +		if (moreSets)
  1.1116 +			{
  1.1117 +			TInt	keyCount=keyStore.Count();
  1.1118 +			for ( TInt event=0; event<iEventStore.Count(); ++event )
  1.1119 +				{
  1.1120 +				for ( TInt key=0; key<keyCount; ++key )
  1.1121 +					{
  1.1122 +					iExpectedStore.AppendL(iEventStore[event]);
  1.1123 +					iExpectedStore.AppendL(keyStore[key]);
  1.1124 +					}
  1.1125 +				}
  1.1126 +
  1.1127 +			TIniDataName	tempStrArray;
  1.1128 +			for ( TInt key=0; key<keyCount; ++key )
  1.1129 +				{
  1.1130 +				if (tempStrArray == _L(""))
  1.1131 +					{
  1.1132 +					tempStrArray.Append(keyStrStore[key]);
  1.1133 +					}
  1.1134 +				else
  1.1135 +					{
  1.1136 +					tempStrArray.Append(_L(" + "));
  1.1137 +					tempStrArray.Append(keyStrStore[key]);
  1.1138 +					}
  1.1139 +				}
  1.1140 +
  1.1141 +			iCombinationStrStore.Append(tempStrArray);
  1.1142 +			}
  1.1143 +		}
  1.1144 +
  1.1145 +	keyStore.Reset();
  1.1146 +	keyStore.Close();
  1.1147 +	keyStrStore.Reset();
  1.1148 +	keyStrStore.Close();
  1.1149 +
  1.1150 +	if (iExpectedStore.Count() > 0)
  1.1151 +		{//end of setup and start testcase
  1.1152 +		iConsole.Write(_L("Keyboard layout test.\n"));
  1.1153 +		iConsole.Write(_L("Press the following keys in the sequence as displayed:\n"));
  1.1154 +		iConsole.Write(iCombinationStrStore[0]);
  1.1155 +		iConsole.Write(_L("\n"));
  1.1156 +		iConsole.Write(_L("and release them in the same sequence."));
  1.1157 +
  1.1158 +		iConsole.Read(iKey, iActiveCombination->iStatus);
  1.1159 +		iActiveCombination->Activate( aAsyncErrorIndex );
  1.1160 +		IncOutstanding(); 	// request an event
  1.1161 +		}
  1.1162 +	else
  1.1163 +		{
  1.1164 +		INFO_PRINTF1(_L("No multiple key sets available"));
  1.1165 +		}
  1.1166 +	}
  1.1167 +
  1.1168 +
  1.1169 +void CT_KeypadDriverData::DoCmdVerifyKeypadState(const TDesC& aSection, const TInt aAsyncErrorIndex)
  1.1170 +/**
  1.1171 + * Function for verifying the keypad state manually if running manual tests
  1.1172 + *
  1.1173 + * @param aSection			The section in the ini containing data for the command
  1.1174 + *
  1.1175 + * @return					void
  1.1176 + *
  1.1177 + * @leave					System wide error
  1.1178 + */
  1.1179 +	{
  1.1180 +	iExpectedState = 0;
  1.1181 +	GetIntFromConfig(aSection, KExpectedState(), iExpectedState);
  1.1182 +
  1.1183 +	TInt	timeOut=0;
  1.1184 +	GetIntFromConfig(aSection, KTimeOut(), timeOut);
  1.1185 +
  1.1186 +	TIniDataName	seconds;
  1.1187 +	seconds.Format(_L("%d"), timeOut / 1000000);
  1.1188 +
  1.1189 +	iConsole.ClearScreen();
  1.1190 +	iConsole.Write(_L("Manual tests enabled...\n"));
  1.1191 +	iConsole.Write(_L("Press any key within "));
  1.1192 +	iConsole.Write(seconds);
  1.1193 +	iConsole.Write(_L(" seconds to check the keypad state..."));
  1.1194 +
  1.1195 +	iConsole.Read(iKey, iActiveKeypadState->iStatus);
  1.1196 +	iActiveKeypadState->Activate( aAsyncErrorIndex, timeOut );
  1.1197 +	IncOutstanding(); 	// request an event
  1.1198 +	}
  1.1199 +
  1.1200 +
  1.1201 +void CT_KeypadDriverData::DoCmdPromptUser(const TDesC& aSection, const TInt aAsyncErrorIndex)
  1.1202 +/**
  1.1203 + * Function for verifying the volume manually if running manual tests
  1.1204 + *
  1.1205 + * @param aSection			The section in the ini containing data for the command
  1.1206 + *
  1.1207 + * @return					void
  1.1208 + *
  1.1209 + * @leave					System wide error
  1.1210 + */
  1.1211 +	{
  1.1212 +	iFailTest = EFalse;
  1.1213 +	GetBoolFromConfig(aSection, KFailTest(), iFailTest);
  1.1214 +
  1.1215 +	if ( !GetStringFromConfig(aSection, KUserPrompt(), iUserPromptStr) )
  1.1216 +		{
  1.1217 +		ERR_PRINTF2(KLogMissingParameter, &KUserPrompt());
  1.1218 +		SetBlockResult(EFail);
  1.1219 +		}
  1.1220 +	else
  1.1221 +		{
  1.1222 +		iConsole.ClearScreen();
  1.1223 +		iConsole.Write(_L("Manual tests enabled...\n"));
  1.1224 +		iConsole.Write(iUserPromptStr);
  1.1225 +
  1.1226 +		if(iFailTest)
  1.1227 +			{
  1.1228 +			GetStringFromConfig(aSection, KPassKeyStr, iPassKeyStr);
  1.1229 +			GetEnumFromConfig(aSection, KPassKey, iEnumTableScanCodes, iPassKey);
  1.1230 +
  1.1231 +			iConsole.Write(_L("Press "));
  1.1232 +			iConsole.Write(iPassKeyStr);
  1.1233 +			iConsole.Write(_L(" to pass the test or any other key to fail->>>"));
  1.1234 +			}
  1.1235 +		else
  1.1236 +			{
  1.1237 +			iConsole.Write(_L("Press any key to continue->>>"));
  1.1238 +			}
  1.1239 +
  1.1240 +		iConsole.Read(iKey, iActivePrompt->iStatus);
  1.1241 +		iActivePrompt->Activate( aAsyncErrorIndex );
  1.1242 +		IncOutstanding(); 	// request an event
  1.1243 +		}
  1.1244 +	}
  1.1245 +
  1.1246 +
  1.1247 +void CT_KeypadDriverData::DoCancel(CActive* aActive, TInt /*aIndex*/)
  1.1248 +	{
  1.1249 +	if( aActive == iActiveKeypadState )
  1.1250 +		{
  1.1251 +		INFO_PRINTF1(_L("Keypad state DoCancel called"));
  1.1252 +
  1.1253 +		iConsole.ReadCancel();
  1.1254 +		DecOutstanding();
  1.1255 +
  1.1256 +		if(iExpectedState == 1)
  1.1257 +			{
  1.1258 +			ERR_PRINTF1(_L("No key press detected. Expected state is 1 (on)"));
  1.1259 +			SetBlockResult(EFail);
  1.1260 +			}
  1.1261 +		else
  1.1262 +			{
  1.1263 +			INFO_PRINTF2(_L("Key press result is corresponding to the expected state: %d"), iExpectedState);
  1.1264 +			}
  1.1265 +		}
  1.1266 +	else
  1.1267 +		{
  1.1268 +		ERR_PRINTF1(_L("An unchecked active object cancelled"));
  1.1269 +		SetBlockResult(EFail);
  1.1270 +		}
  1.1271 +	}
  1.1272 +
  1.1273 +void CT_KeypadDriverData::RunL(CActive* aActive, TInt aIndex)
  1.1274 +	{
  1.1275 +	DecOutstanding();
  1.1276 +	TBool	straySignal		= EFalse;
  1.1277 +	TBool	furtherRequest	= EFalse;
  1.1278 +
  1.1279 +	TBool	isCombination	= EFalse;
  1.1280 +	TBool	isPrompt		= EFalse;
  1.1281 +
  1.1282 +	if( aActive == iActiveKey )
  1.1283 +		{
  1.1284 +		INFO_PRINTF1(_L("RunL called"));
  1.1285 +
  1.1286 +		isCombination			= EFalse;
  1.1287 +		isPrompt				= EFalse;
  1.1288 +		TInt	eventType		= iKey.Type();
  1.1289 +		TInt	scanCode		= iKey.Code();
  1.1290 +
  1.1291 +		if( eventType == TRawEvent::EKeyDown || eventType == TRawEvent::EKeyUp)
  1.1292 +			{
  1.1293 +			INFO_PRINTF2(_L("Raw Event: %d"), eventType);
  1.1294 +
  1.1295 +			iActualStore.AppendL(eventType);
  1.1296 +			iActualStore.AppendL(scanCode);
  1.1297 +
  1.1298 +			INFO_PRINTF2(_L("Expected scancode string: %S"), &iAllPossibleKeysStrStore[iKeyCount]);
  1.1299 +			INFO_PRINTF2(_L("Actual scancode: %d"), scanCode);
  1.1300 +
  1.1301 +			if (eventType == TRawEvent::EKeyUp)
  1.1302 +				{
  1.1303 +				if(iKeyCount < iAllPossibleKeysStore.Count() - 1)
  1.1304 +					{
  1.1305 +					furtherRequest = ETrue;
  1.1306 +					iKeyCount++;
  1.1307 +					}
  1.1308 +				else
  1.1309 +					{
  1.1310 +					furtherRequest = EFalse;
  1.1311 +					}
  1.1312 +				}
  1.1313 +			else
  1.1314 +				{
  1.1315 +				furtherRequest = ETrue;
  1.1316 +				}
  1.1317 +			}
  1.1318 +		else
  1.1319 +			{
  1.1320 +			ERR_PRINTF2(_L("Unexpected Raw Event: %d"), eventType);
  1.1321 +			SetBlockResult(EFail);
  1.1322 +			furtherRequest = ETrue;
  1.1323 +			}
  1.1324 +		}
  1.1325 +	else if( aActive == iActiveCombination )
  1.1326 +		{
  1.1327 +		INFO_PRINTF1(_L("RunL called"));
  1.1328 +
  1.1329 +		isCombination				= ETrue;
  1.1330 +		isPrompt					= EFalse;
  1.1331 +		TInt 	eventType			= iKey.Type();
  1.1332 +		TInt	scanCode			= iKey.Code();
  1.1333 +
  1.1334 +		if( eventType == TRawEvent::EKeyDown )
  1.1335 +			{
  1.1336 +			INFO_PRINTF2(_L("Raw Event: %d"), eventType);
  1.1337 +
  1.1338 +			iActualStore.AppendL(eventType);
  1.1339 +			iActualStore.AppendL(scanCode);
  1.1340 +
  1.1341 +			INFO_PRINTF2(_L("Expected scancode string: %S"), &iCombinationStrStore[iCombinationCount]);
  1.1342 +			INFO_PRINTF2(_L("Actual scancode: %d"), scanCode);
  1.1343 +
  1.1344 +			iCombinationKeyCount++;
  1.1345 +
  1.1346 +			furtherRequest = ETrue;
  1.1347 +			}
  1.1348 +		else if ( eventType == TRawEvent::EKeyUp )
  1.1349 +			{
  1.1350 +			INFO_PRINTF2(_L("Raw Event: %d"), eventType);
  1.1351 +
  1.1352 +			iActualStore.AppendL(eventType);
  1.1353 +			iActualStore.AppendL(scanCode);
  1.1354 +
  1.1355 +			INFO_PRINTF2(_L("Actual scancode: %d"), scanCode);
  1.1356 +
  1.1357 +			iCombinationKeyCount--;
  1.1358 +
  1.1359 +			if(iCombinationCount < iCombinationStrStore.Count() - 1 && iCombinationKeyCount == 0)
  1.1360 +				{
  1.1361 +				furtherRequest = ETrue;
  1.1362 +				iCombinationCount++;
  1.1363 +				}
  1.1364 +			else if (iCombinationKeyCount != 0)
  1.1365 +				{
  1.1366 +				furtherRequest = ETrue;
  1.1367 +				}
  1.1368 +			else
  1.1369 +				{
  1.1370 +				furtherRequest = EFalse;
  1.1371 +				}
  1.1372 +			}
  1.1373 +		else
  1.1374 +			{
  1.1375 +			ERR_PRINTF2(_L("Unexpected Raw Event: %d"), eventType);
  1.1376 +			SetBlockResult(EFail);
  1.1377 +			furtherRequest = ETrue;
  1.1378 +			}
  1.1379 +		}
  1.1380 +	else if( aActive == iActiveKeypadState )
  1.1381 +		{
  1.1382 +		INFO_PRINTF1(_L("RunL called"));
  1.1383 +
  1.1384 +		TInt eventType = iKey.Type();
  1.1385 +		TInt scanCode  = iKey.Code();
  1.1386 +
  1.1387 +		if(eventType == TRawEvent::EKeyDown && scanCode != 0)
  1.1388 +			{
  1.1389 +			iActiveKeypadState->KillTimer();
  1.1390 +			DecOutstanding();
  1.1391 +
  1.1392 +			if(iExpectedState == 0)
  1.1393 +				{
  1.1394 +				ERR_PRINTF1(_L("Key press detected. Expected state is 0 (off)"));
  1.1395 +				SetBlockResult(EFail);
  1.1396 +				}
  1.1397 +			else
  1.1398 +				{
  1.1399 +				INFO_PRINTF2(_L("Key press result is corresponding to the expected state: %d"), iExpectedState);
  1.1400 +				}
  1.1401 +			}
  1.1402 +		}
  1.1403 +	else if ( aActive == iActivePrompt )
  1.1404 +		{
  1.1405 +		INFO_PRINTF1(_L("Prompt RunL called"));
  1.1406 +
  1.1407 +		isCombination		= EFalse;
  1.1408 +		isPrompt			= ETrue;
  1.1409 +		TInt	eventType	= iKey.Type();
  1.1410 +		TInt	scanCode	= iKey.Code();
  1.1411 +
  1.1412 +		if (iFailTest)
  1.1413 +			{
  1.1414 +			if(eventType == TRawEvent::EKeyDown && scanCode != iPassKey)
  1.1415 +				{
  1.1416 +				ERR_PRINTF1(_L("Test failed - User verifies that the result is not as expected"));
  1.1417 +				SetBlockResult(EFail);
  1.1418 +				furtherRequest = EFalse;
  1.1419 +				}
  1.1420 +			else if (eventType == TRawEvent::EKeyDown && scanCode == iPassKey)
  1.1421 +				{
  1.1422 +				INFO_PRINTF1(_L("Test passed - User verifies that the result is as expected"));
  1.1423 +				furtherRequest = EFalse;
  1.1424 +				}
  1.1425 +			else if (eventType == TRawEvent::EKeyUp)
  1.1426 +				{
  1.1427 +				furtherRequest = ETrue;
  1.1428 +				}
  1.1429 +			else
  1.1430 +				{
  1.1431 +				ERR_PRINTF2(_L("Unexpected Raw Event: %d"), eventType);
  1.1432 +				SetBlockResult(EFail);
  1.1433 +				furtherRequest = ETrue;
  1.1434 +				}
  1.1435 +			}
  1.1436 +		else
  1.1437 +			{
  1.1438 +			if(eventType == TRawEvent::EKeyDown)
  1.1439 +				{
  1.1440 +				INFO_PRINTF1(_L("Continuing..."));
  1.1441 +				furtherRequest = EFalse;
  1.1442 +				}
  1.1443 +			else if (eventType == TRawEvent::EKeyUp)
  1.1444 +				{
  1.1445 +				furtherRequest = ETrue;
  1.1446 +				}
  1.1447 +			else
  1.1448 +				{
  1.1449 +				ERR_PRINTF2(_L("Unexpected Raw Event: %d"), eventType);
  1.1450 +				SetBlockResult(EFail);
  1.1451 +				furtherRequest = ETrue;
  1.1452 +				}
  1.1453 +			}
  1.1454 +		}
  1.1455 +	else
  1.1456 +		{
  1.1457 +		ERR_PRINTF1(_L("An unchecked active object completed"));
  1.1458 +		SetBlockResult(EFail);
  1.1459 +		straySignal = ETrue;
  1.1460 +		}
  1.1461 +
  1.1462 +	if( !straySignal )
  1.1463 +		{
  1.1464 +		TInt	err = aActive->iStatus.Int();
  1.1465 +		if( err != KErrNone )
  1.1466 +			{
  1.1467 +			if(aActive == iActiveKeypadState && err == KErrCancel)
  1.1468 +				{
  1.1469 +				if(iExpectedState == 1)
  1.1470 +					{
  1.1471 +					ERR_PRINTF1(_L("No key press detected. Expected state is 1 (on)"));
  1.1472 +					SetBlockResult(EFail);
  1.1473 +					}
  1.1474 +				else
  1.1475 +					{
  1.1476 +					INFO_PRINTF2(_L("Key press result is corresponding to the expected state: %d"), iExpectedState);
  1.1477 +					}
  1.1478 +				}
  1.1479 +			else
  1.1480 +				{
  1.1481 +				ERR_PRINTF2(_L("RunL Error %d"), err);
  1.1482 +				SetAsyncError( aIndex, err );
  1.1483 +				}
  1.1484 +			}
  1.1485 +		else
  1.1486 +			{
  1.1487 +			if(furtherRequest)// check if re-issue required
  1.1488 +				{
  1.1489 +				iConsole.ClearScreen();
  1.1490 +				INFO_PRINTF1(_L("Re-issuing Read"));
  1.1491 +
  1.1492 +				if(!isCombination && !isPrompt)
  1.1493 +					{
  1.1494 +					iConsole.Write(_L("Press the key corresponding to the "));
  1.1495 +					iConsole.Write(iAllPossibleKeysStrStore[iKeyCount]);
  1.1496 +
  1.1497 +					iConsole.Read(iKey, iActiveKey->iStatus);
  1.1498 +					iActiveKey->Activate(aIndex);
  1.1499 +					IncOutstanding();
  1.1500 +					}
  1.1501 +				else if (!isPrompt)
  1.1502 +					{
  1.1503 +					iConsole.Write(_L("Press the following keys in the same sequence as displayed:\n"));
  1.1504 +					iConsole.Write(iCombinationStrStore[iCombinationCount]);
  1.1505 +					iConsole.Write(_L("\n"));
  1.1506 +					iConsole.Write(_L("and release them in the same sequence."));
  1.1507 +
  1.1508 +					iConsole.Read(iKey, iActiveCombination->iStatus);
  1.1509 +					iActiveCombination->Activate(aIndex);
  1.1510 +					IncOutstanding();
  1.1511 +					}
  1.1512 +				else{
  1.1513 +					iConsole.Write(iUserPromptStr);
  1.1514 +
  1.1515 +					if(iFailTest)
  1.1516 +						{
  1.1517 +						iConsole.Write(_L("Press "));
  1.1518 +						iConsole.Write(iPassKeyStr);
  1.1519 +						iConsole.Write(_L(" to pass the test or any other key to fail->>>"));
  1.1520 +						}
  1.1521 +					else
  1.1522 +						{
  1.1523 +						iConsole.Write(_L("Press any key to continue->>>"));
  1.1524 +						}
  1.1525 +
  1.1526 +					iConsole.Read(iKey, iActivePrompt->iStatus);
  1.1527 +					iActivePrompt->Activate( aIndex );
  1.1528 +					IncOutstanding();
  1.1529 +					}
  1.1530 +				}
  1.1531 +			else
  1.1532 +				{
  1.1533 +				if(aActive == iActiveKeypadState)
  1.1534 +					{
  1.1535 +					if ( iExpectedState == 0 )
  1.1536 +						{
  1.1537 +						ERR_PRINTF1(_L("Expected state is 0 (off). Verifying keypad state should have been cancelled."));
  1.1538 +						SetBlockResult(EFail);
  1.1539 +						}
  1.1540 +					else
  1.1541 +						{
  1.1542 +						INFO_PRINTF2(_L("Key press result is corresponding to the expected state: %d"), iExpectedState);
  1.1543 +						}
  1.1544 +					}
  1.1545 +				else
  1.1546 +					{
  1.1547 +					INFO_PRINTF1(_L("RunL call completed successfully"));
  1.1548 +					ProcessResults();	//process results
  1.1549 +					}
  1.1550 +				}
  1.1551 +			}
  1.1552 +		}
  1.1553 +	}
  1.1554 +
  1.1555 +void CT_KeypadDriverData::ProcessResults()
  1.1556 +	{
  1.1557 +	INFO_PRINTF1(_L("Processing results"));
  1.1558 +
  1.1559 +	if (iActualStore.Count() == iExpectedStore.Count())
  1.1560 +		{
  1.1561 +		for(TInt i = 0; i < iActualStore.Count(); i+=2)
  1.1562 +			{
  1.1563 +			if(	iActualStore[i] != iExpectedStore[i]	)//compare event
  1.1564 +				{
  1.1565 +				ERR_PRINTF3(_L("Expected event (%d) does not match Actual event (%d)! "), iExpectedStore[i], iActualStore[i]);
  1.1566 +				SetBlockResult(EFail);
  1.1567 +				}
  1.1568 +			else
  1.1569 +				{
  1.1570 +				INFO_PRINTF2(_L("Expected event was: %d, Actual event matches the expected one."), iExpectedStore[i]);
  1.1571 +				}
  1.1572 +
  1.1573 +			if(iActualStore[i+1] == iExpectedStore[i+1])
  1.1574 +				{
  1.1575 +				INFO_PRINTF2(_L("Expected scancode was: %d. Actual scancode matches the expected one."), iExpectedStore[i+1]);
  1.1576 +				}
  1.1577 +			else
  1.1578 +				{
  1.1579 +				ERR_PRINTF3(_L("Actual scancode (%d) != expected scancode (%d)"), iActualStore[i+1], iExpectedStore[i+1]);
  1.1580 +				SetBlockResult(EFail);
  1.1581 +				}
  1.1582 +			}
  1.1583 +		}
  1.1584 +	else
  1.1585 +		{
  1.1586 +		ERR_PRINTF3(_L("Actual results array count (%d) != expected results array count (%d)"), iActualStore.Count(), iExpectedStore.Count());
  1.1587 +		SetBlockResult(EFail);
  1.1588 +		}
  1.1589 +	}