author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 23 Jun 2010 18:12:20 +0300 | |
changeset 45 | 6b911d05207e |
parent 37 | ba76fc04e6c2 |
permissions | -rw-r--r-- |
37 | 1 |
/* |
2 |
* Copyright (c) 2007 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: Key event forwarder. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
// INCLUDE FILES |
|
20 |
#include <eikenv.h> |
|
21 |
#include <eikappui.h> |
|
22 |
#include <bldvariant.hrh> |
|
23 |
#include <featmgr.h> |
|
24 |
#include <PtiDefs.h> |
|
25 |
||
26 |
#include "mphonestatemachine.h" |
|
27 |
#include "mphonekeyeventhandler.h" |
|
28 |
#include "cphonekeys.h" |
|
29 |
#include "cphonekeyeventforwarder.h" |
|
30 |
#include "cphonepubsubproxy.h" |
|
31 |
#include "cphonetimer.h" |
|
32 |
#include "phonelogger.h" |
|
33 |
#include "phoneui.pan" |
|
34 |
||
35 |
// ============================ MEMBER FUNCTIONS =============================== |
|
36 |
||
37 |
// ----------------------------------------------------------------------------- |
|
38 |
// CPhoneKeyEventForwarder::NewL |
|
39 |
// ----------------------------------------------------------------------------- |
|
40 |
// |
|
41 |
CPhoneKeyEventForwarder* CPhoneKeyEventForwarder::NewL( |
|
42 |
const TRect& aRect, |
|
43 |
MPhoneStateMachine* aStateMachine, |
|
44 |
MPhoneViewCommandHandle* aViewCommandHandle ) |
|
45 |
{ |
|
46 |
CPhoneKeyEventForwarder* self = |
|
47 |
new (ELeave) CPhoneKeyEventForwarder( aStateMachine, aViewCommandHandle ); |
|
48 |
||
49 |
CleanupStack::PushL( self ); |
|
50 |
self->ConstructL( aRect ); |
|
51 |
CleanupStack::Pop( self ); |
|
52 |
||
53 |
return self; |
|
54 |
} |
|
55 |
||
56 |
// ----------------------------------------------------------------------------- |
|
57 |
// CPhoneKeyEventForwarder::~CPhoneKeyEventForwarder |
|
58 |
// ----------------------------------------------------------------------------- |
|
59 |
// |
|
60 |
CPhoneKeyEventForwarder::~CPhoneKeyEventForwarder() |
|
61 |
{ |
|
62 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneKeyEventForwarder::~CPhoneKeyEventForwarder"); |
|
63 |
||
64 |
CEikonEnv* env = static_cast<CEikonEnv*>(ControlEnv()); |
|
65 |
if( env ) |
|
66 |
{ |
|
67 |
env->EikAppUi()->RemoveFromStack( this ); |
|
68 |
} |
|
69 |
delete iLongPressKeyEventTimer; |
|
70 |
} |
|
71 |
||
72 |
// ----------------------------------------------------------------------------- |
|
73 |
// CPhoneKeyEventForwarder::CountComponentControls |
|
74 |
// ----------------------------------------------------------------------------- |
|
75 |
// |
|
76 |
TInt CPhoneKeyEventForwarder::CountComponentControls() const |
|
77 |
{ |
|
78 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneKeyEventForwarder::CountComponentControls"); |
|
79 |
return 0; |
|
80 |
} |
|
81 |
||
82 |
// ----------------------------------------------------------------------------- |
|
83 |
// CPhoneKeyEventForwarder::ComponentControl |
|
84 |
// ----------------------------------------------------------------------------- |
|
85 |
// |
|
86 |
CCoeControl* CPhoneKeyEventForwarder::ComponentControl( |
|
87 |
TInt /*aIndex*/ ) const |
|
88 |
{ |
|
89 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneKeyEventForwarder::ComponentControl"); |
|
90 |
return NULL; |
|
91 |
} |
|
92 |
||
93 |
// ----------------------------------------------------------------------------- |
|
94 |
// CPhoneKeyEventForwarder::SizeChanged |
|
95 |
// ----------------------------------------------------------------------------- |
|
96 |
// |
|
97 |
void CPhoneKeyEventForwarder::SizeChanged() |
|
98 |
{ |
|
99 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneKeyEventForwarder::SizeChanged"); |
|
100 |
} |
|
101 |
||
102 |
// ----------------------------------------------------------------------------- |
|
103 |
// CPhoneKeyEventForwarder::Draw |
|
104 |
// ----------------------------------------------------------------------------- |
|
105 |
// |
|
106 |
void CPhoneKeyEventForwarder::Draw( |
|
107 |
const TRect& /*aRect*/ ) const |
|
108 |
{ |
|
109 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneKeyEventForwarder::Draw"); |
|
110 |
} |
|
111 |
||
112 |
// ----------------------------------------------------------------------------- |
|
113 |
// CPhoneKeyEventForwarder::OfferKeyEventL |
|
114 |
// Checks is hte keyevent such that the number entry can be opened |
|
115 |
// ----------------------------------------------------------------------------- |
|
116 |
// |
|
117 |
TKeyResponse CPhoneKeyEventForwarder::OfferKeyEventL( |
|
118 |
const TKeyEvent& aKeyEvent, |
|
119 |
TEventCode aType ) |
|
120 |
{ |
|
121 |
__LOGMETHODSTARTEND( EPhoneControl, |
|
122 |
"CPhoneKeyEventForwarder::OfferKeyEventL"); |
|
123 |
||
124 |
TKeyResponse ret( EKeyWasNotConsumed ); |
|
125 |
TKeyEvent keyEvent = aKeyEvent; |
|
126 |
||
127 |
ret = OfferKeyEventBeforeControlStackL( aKeyEvent, aType ); |
|
128 |
||
129 |
// Convert event. Use already converted iKeyPressedDown. |
|
130 |
// Do not convert other than DTMF tones |
|
131 |
if( CPhoneKeys::IsDtmfTone( aKeyEvent, aType ) ) |
|
132 |
{ |
|
133 |
keyEvent.iCode = iKeyPressedDown; |
|
134 |
} |
|
135 |
||
136 |
if ( !keyEvent.iRepeats ) |
|
137 |
{ |
|
138 |
// Start and stop dtmf |
|
139 |
iStateMachine->State()->HandleDtmfKeyToneL( keyEvent, aType ); |
|
140 |
if( aType != EEventKeyUp && |
|
141 |
( CPhoneKeys::IsNumericKey( keyEvent, aType ) || |
|
142 |
IsAlphaNumericKey( keyEvent ) ) |
|
143 |
) |
|
144 |
{ |
|
145 |
// Do not open number entry with up key |
|
146 |
iStateMachine->State()->HandleCreateNumberEntryL( keyEvent, aType ); |
|
147 |
} |
|
148 |
} |
|
149 |
||
150 |
return ret; |
|
151 |
} |
|
152 |
||
153 |
// ----------------------------------------------------------------------------- |
|
154 |
// CPhoneKeyEventForwarder::CPhoneKeyEventForwarder |
|
155 |
// ----------------------------------------------------------------------------- |
|
156 |
// |
|
157 |
CPhoneKeyEventForwarder::CPhoneKeyEventForwarder( |
|
158 |
MPhoneStateMachine* aStateMachine, |
|
159 |
MPhoneViewCommandHandle* aViewCommandHandle ) |
|
160 |
: iStateMachine( aStateMachine ), |
|
161 |
iViewCommandHandle( aViewCommandHandle ) |
|
162 |
{ |
|
163 |
__LOGMETHODSTARTEND( EPhoneControl, |
|
164 |
"CPhoneKeyEventForwarder::CPhoneKeyEventForwarder"); |
|
165 |
} |
|
166 |
||
167 |
// ----------------------------------------------------------------------------- |
|
168 |
// CPhoneKeyEventForwarder::ConstructL |
|
169 |
// ----------------------------------------------------------------------------- |
|
170 |
// |
|
171 |
void CPhoneKeyEventForwarder::ConstructL( const TRect& aRect ) |
|
172 |
{ |
|
173 |
__LOGMETHODSTARTEND( EPhoneControl, |
|
174 |
"CPhoneKeyEventForwarder::ConstructL"); |
|
175 |
||
176 |
if ( FeatureManager::FeatureSupported( KFeatureIdKeypadNoSlider ) ) |
|
177 |
{ |
|
178 |
RWindowGroup& groupWin = iCoeEnv->RootWin(); |
|
179 |
} |
|
180 |
// Create invisible control. |
|
181 |
CreateWindowL(); |
|
182 |
MakeVisible( EFalse ); |
|
183 |
SetRect( aRect ); |
|
184 |
||
185 |
CEikonEnv* env = static_cast<CEikonEnv*>(ControlEnv()); |
|
186 |
if( env ) |
|
187 |
{ |
|
188 |
env->EikAppUi()->AddToStackL( |
|
189 |
this, |
|
190 |
ECoeStackPriorityEnvironmentFilter, |
|
191 |
ECoeStackFlagRefusesFocus ); |
|
192 |
} |
|
193 |
||
194 |
// Create the long press key event timer |
|
195 |
iLongPressKeyEventTimer = CPhoneTimer::NewL(); |
|
196 |
} |
|
197 |
||
198 |
// ----------------------------------------------------------------------------- |
|
199 |
// CPhoneKeyEventForwarder::IsAlphaNumericKey |
|
200 |
// ----------------------------------------------------------------------------- |
|
201 |
// |
|
202 |
TBool CPhoneKeyEventForwarder::IsAlphaNumericKey( const TKeyEvent& aKeyEvent ) |
|
203 |
{ |
|
204 |
__LOGMETHODSTARTEND( EPhoneControl, |
|
205 |
"CPhoneKeyEventForwarder::IsAlphaNumericKey"); |
|
206 |
||
207 |
TBool alphaNumeric = |
|
208 |
iStateMachine->State()->IsAlphanumericSupportedAndCharInput( aKeyEvent ); |
|
209 |
||
210 |
return alphaNumeric; |
|
211 |
} |
|
212 |
||
213 |
||
214 |
// ----------------------------------------------------------------------------- |
|
215 |
// CPhoneKeyEventForwarder::OfferKeyEventBeforeControlStackL |
|
216 |
// Let phone handle before other components in control stack |
|
217 |
// ----------------------------------------------------------------------------- |
|
218 |
// |
|
219 |
TKeyResponse CPhoneKeyEventForwarder::OfferKeyEventBeforeControlStackL( |
|
220 |
const TKeyEvent& aKeyEvent, |
|
221 |
TEventCode aType ) |
|
222 |
{ |
|
223 |
__LOGMETHODSTARTEND( EPhoneControl, |
|
224 |
"CPhoneKeyEventForwarder::OfferKeyEventBeforeControlStackL"); |
|
225 |
||
226 |
TKeyResponse response( EKeyWasNotConsumed ); |
|
227 |
if( !IsKeyBlocked( aKeyEvent ) ) |
|
228 |
{ |
|
229 |
// Handle key events before FEP |
|
230 |
// This is must becouse FEP consumes * key and when |
|
231 |
// editor is in alphanumeric mode FEP consumes all alphanumeric |
|
232 |
// keys |
|
233 |
switch( aType ) |
|
234 |
{ |
|
235 |
// EEventKeyDown |
|
236 |
case EEventKeyDown: |
|
237 |
response = HandleEventKeyDownBeforeControlStackL( aKeyEvent ); |
|
238 |
break; |
|
239 |
// EEventKey |
|
240 |
case EEventKey: |
|
241 |
response = HandleEventKeyBeforeControlStackL( aKeyEvent ); |
|
242 |
break; |
|
243 |
// EEventKeyUp |
|
244 |
case EEventKeyUp: |
|
245 |
response = HandleEventKeyUpBeforeControlStackL( aKeyEvent ); |
|
246 |
break; |
|
247 |
default: |
|
248 |
break; |
|
249 |
} |
|
250 |
||
251 |
} |
|
252 |
return response; |
|
253 |
} |
|
254 |
||
255 |
||
256 |
// ----------------------------------------------------------------------------- |
|
257 |
// CPhoneKeyEventForwarder::OfferKeyEventAfterControlStackL |
|
258 |
// Let phone handle keys if no one has done it already |
|
259 |
// ----------------------------------------------------------------------------- |
|
260 |
// |
|
261 |
TKeyResponse CPhoneKeyEventForwarder::OfferKeyEventAfterControlStackL( |
|
262 |
const TKeyEvent& aKeyEvent, |
|
263 |
TEventCode aType ) |
|
264 |
{ |
|
265 |
__LOGMETHODSTARTEND( EPhoneControl, |
|
266 |
"CPhoneKeyEventForwarder::OfferKeyEventAfterControlStackL"); |
|
267 |
||
268 |
if( !IsKeyBlocked( aKeyEvent ) ) |
|
269 |
{ |
|
270 |
// Send key to editor |
|
271 |
iStateMachine->State()->HandleKeyEventL( aKeyEvent, aType ); |
|
272 |
||
273 |
if( EEventKeyUp == aType |
|
274 |
&& EKeyNull != iKeyPressedDown ) |
|
275 |
{ |
|
276 |
// Handle short key press |
|
277 |
iStateMachine->State()->HandleKeyMessageL( |
|
278 |
MPhoneKeyEvents::EPhoneKeyShortPress, |
|
279 |
TKeyCode( iKeyPressedDown ) ); |
|
280 |
||
281 |
// Reset key code |
|
282 |
iScanCode = EStdKeyNull; |
|
283 |
iKeyPressedDown = EKeyNull; |
|
284 |
} |
|
285 |
} |
|
286 |
||
287 |
return EKeyWasNotConsumed; |
|
288 |
} |
|
289 |
||
290 |
// ----------------------------------------------------------- |
|
291 |
// CPhoneKeyEventForwarder::HandleEventKeyDownBeforeControlStackL |
|
292 |
// ----------------------------------------------------------- |
|
293 |
// |
|
294 |
TKeyResponse CPhoneKeyEventForwarder::HandleEventKeyDownBeforeControlStackL( |
|
295 |
const TKeyEvent& aKeyEvent ) |
|
296 |
{ |
|
297 |
__LOGMETHODSTARTEND( EPhoneControl, |
|
298 |
"CPhoneKeyEventForwarder::HandleEventKeyDownBeforeControlStackL"); |
|
299 |
||
300 |
// Convert key code |
|
301 |
ConvertKeyCode( iKeyPressedDown, aKeyEvent ); |
|
302 |
// Save key scan code |
|
303 |
iScanCode = aKeyEvent.iScanCode; |
|
304 |
||
305 |
// Start the key press timer |
|
306 |
iKeyPressTime.UniversalTime(); |
|
307 |
||
308 |
// Cancel the long press key event timer, if it is active |
|
309 |
if ( iLongPressKeyEventTimer->IsActive() ) |
|
310 |
{ |
|
311 |
iLongPressKeyEventTimer->CancelTimer(); |
|
312 |
} |
|
313 |
||
314 |
// Re-start the timer |
|
315 |
iLongPressKeyEventTimer->After( |
|
316 |
KPhoneLongPressKeyEventDuration, |
|
317 |
TCallBack( DoHandleLongPressKeyEventCallbackL, |
|
318 |
this ) ); |
|
319 |
||
320 |
return ( EKeyWasNotConsumed ); |
|
321 |
} |
|
322 |
||
323 |
// ----------------------------------------------------------- |
|
324 |
// CPhoneKeyEventForwarder::HandleEventKeyBeforeControlStackL |
|
325 |
// Both short key press event (iRepeats == 0) and |
|
326 |
// long key press event (iRepeats == 1) are handled here |
|
327 |
// ----------------------------------------------------------- |
|
328 |
// |
|
329 |
TKeyResponse CPhoneKeyEventForwarder::HandleEventKeyBeforeControlStackL( |
|
330 |
const TKeyEvent& aKeyEvent ) |
|
331 |
{ |
|
332 |
__LOGMETHODSTARTEND( EPhoneControl, |
|
333 |
"CPhoneKeyEventForwarder::HandleEventKeyBeforeControlStackL"); |
|
334 |
||
335 |
TKeyResponse response( EKeyWasNotConsumed ); |
|
336 |
||
337 |
// Convert event. |
|
338 |
TKeyEvent keyEvent = aKeyEvent; |
|
339 |
keyEvent.iCode = iKeyPressedDown; |
|
340 |
||
341 |
if( aKeyEvent.iRepeats > 0 && |
|
342 |
CPhoneKeys::IsDtmfTone( keyEvent, EEventKey ) ) |
|
343 |
{ |
|
344 |
// Do not repeat dtmf characters |
|
345 |
response = EKeyWasConsumed; |
|
346 |
} |
|
347 |
||
348 |
return response; |
|
349 |
} |
|
350 |
||
351 |
// ----------------------------------------------------------- |
|
352 |
// CPhoneKeyEventForwarder::HandleEventKeyUpBeforeControlStackL |
|
353 |
// ----------------------------------------------------------- |
|
354 |
// |
|
355 |
TKeyResponse CPhoneKeyEventForwarder::HandleEventKeyUpBeforeControlStackL( |
|
356 |
const TKeyEvent& aKeyEvent ) |
|
357 |
{ |
|
358 |
__LOGMETHODSTARTEND( EPhoneControl, |
|
359 |
"CPhoneKeyEventForwarder::HandleEventKeyUpBeforeControlStackL"); |
|
360 |
||
361 |
// Send a long press key event to the current state provided |
|
362 |
// that the key scan code is the same as the key that was pressed |
|
363 |
if ( iScanCode == aKeyEvent.iScanCode ) |
|
364 |
{ |
|
365 |
// Pass the key press duration to the current state |
|
366 |
TTime now; |
|
367 |
now.UniversalTime(); |
|
368 |
TTimeIntervalMicroSeconds keyPressDuration = now.MicroSecondsFrom( |
|
369 |
iKeyPressTime ); |
|
370 |
iStateMachine->State()->HandleKeyPressDurationL( |
|
371 |
TKeyCode( iKeyPressedDown ), |
|
372 |
keyPressDuration ); |
|
373 |
||
374 |
// Cancel the long press timer, if it is active. Otherwise |
|
375 |
// ignore the key event since it was already handled as a long press |
|
376 |
// key event. |
|
377 |
if ( iLongPressKeyEventTimer->IsActive() ) |
|
378 |
{ |
|
379 |
iLongPressKeyEventTimer->CancelTimer(); |
|
380 |
} |
|
381 |
} |
|
382 |
||
383 |
return EKeyWasNotConsumed; |
|
384 |
} |
|
385 |
||
386 |
// --------------------------------------------------------- |
|
387 |
// CPhoneKeyEventForwarder::DoHandleLongPressKeyEventCallback |
|
388 |
// |
|
389 |
// This routine is called when the long press key event timer expires |
|
390 |
// after KPhoneLongPressKeyEventDuration. |
|
391 |
// --------------------------------------------------------- |
|
392 |
// |
|
393 |
TInt CPhoneKeyEventForwarder::DoHandleLongPressKeyEventCallbackL( TAny* aAny ) |
|
394 |
{ |
|
395 |
__LOGMETHODSTARTEND( EPhoneControl, |
|
396 |
"CPhoneKeyEventForwarder::DoHandleLongPressKeyEventCallbackL"); |
|
397 |
||
398 |
__ASSERT_DEBUG( aAny, |
|
399 |
Panic( EPhoneCtrlUnknownPanic ) ); |
|
400 |
||
401 |
reinterpret_cast< CPhoneKeyEventForwarder* >( aAny )-> |
|
402 |
HandleLongPressKeyEventL(); |
|
403 |
||
404 |
return KErrNone; |
|
405 |
} |
|
406 |
||
407 |
// --------------------------------------------------------- |
|
408 |
// CPhoneKeyEventForwarder::HandleLongPressKeyEventL |
|
409 |
// Handle long press key event |
|
410 |
// --------------------------------------------------------- |
|
411 |
// |
|
412 |
void CPhoneKeyEventForwarder::HandleLongPressKeyEventL() |
|
413 |
{ |
|
414 |
__LOGMETHODSTARTEND( EPhoneControl, |
|
415 |
"CPhoneKeyEventForwarder::HandleLongPressKeyEventL"); |
|
416 |
||
417 |
// In alphanumeric mode EEventKey-event is not received so we must |
|
418 |
// compare also with scan code. |
|
419 |
if ( KPhoneDtmfHashCharacter == iKeyPressedDown ) |
|
420 |
{ |
|
421 |
// Separate handling for long hash key because there is so much |
|
422 |
// different functionality under it and it works differently |
|
423 |
// in different protocols. |
|
424 |
iStateMachine->State()->HandleLongHashL(); |
|
425 |
} |
|
426 |
else if ( KPhoneDtmfStarCharacter == iKeyPressedDown ) |
|
427 |
{ |
|
428 |
// KPhoneDtmfStarCharacter value used in configuration file for |
|
429 |
// long key press application launching |
|
430 |
iStateMachine->State()->HandleKeyMessageL( |
|
431 |
MPhoneKeyEvents::EPhoneKeyLongPress, |
|
432 |
TKeyCode( KPhoneDtmfStarCharacter ) ); |
|
433 |
} |
|
434 |
else |
|
435 |
{ |
|
436 |
__PHONELOG1( |
|
437 |
EBasic, EPhoneControl, |
|
438 |
"CPhoneKeyEventHandler::HandleLongPressKeyEventL iCode(%d)", |
|
439 |
iKeyPressedDown ); |
|
440 |
iStateMachine->State()->HandleKeyMessageL( |
|
441 |
MPhoneKeyEvents::EPhoneKeyLongPress, |
|
442 |
TKeyCode( iKeyPressedDown ) ); |
|
443 |
} |
|
444 |
||
445 |
// Reset key code |
|
446 |
iScanCode = EStdKeyNull; |
|
447 |
iKeyPressedDown = EKeyNull; |
|
448 |
} |
|
449 |
||
450 |
// ----------------------------------------------------------- |
|
451 |
// CPhoneKeyEventForwarder::ConvertKeyCode |
|
452 |
// ----------------------------------------------------------- |
|
453 |
// |
|
454 |
void CPhoneKeyEventForwarder::ConvertKeyCode( TUint& aCode, |
|
455 |
const TKeyEvent& aKeyEvent ) |
|
456 |
{ |
|
457 |
__LOGMETHODSTARTEND( EPhoneControl, |
|
458 |
"CPhoneKeyEventForwarder::ConvertKeyCode"); |
|
459 |
||
460 |
// Handler for special device key mapping in case iScanCode |
|
461 |
// to iCode conversion hasn't been handled by CAknAppUi::GetAliasKeyCodeL |
|
462 |
__PHONELOG1( EBasic, EPhoneControl, |
|
463 |
"CPhoneKeyEventHandler::ConvertKeyCode scan code (%d)", |
|
464 |
aKeyEvent.iScanCode ); |
|
465 |
||
466 |
switch ( aKeyEvent.iScanCode ) |
|
467 |
{ |
|
468 |
case EStdKeyEnter: |
|
469 |
aCode = EKeyEnter; |
|
470 |
break; |
|
471 |
case EStdKeyYes: |
|
472 |
aCode = EKeyYes; |
|
473 |
break; |
|
474 |
case EStdKeyNo: |
|
475 |
aCode = EKeyNo; |
|
476 |
break; |
|
477 |
case EStdKeyDeviceF: |
|
478 |
aCode = EKeyDeviceF; // EStdKeyDeviceF mapping for unlock switch. |
|
479 |
break; |
|
480 |
case EStdKeyHash: |
|
481 |
aCode = KPhoneDtmfHashCharacter; |
|
482 |
break; |
|
483 |
case EStdKeyNkpAsterisk: |
|
484 |
aCode = KPhoneDtmfStarCharacter; |
|
485 |
break; |
|
486 |
case EStdKeyApplication0: |
|
487 |
aCode = EKeyApplication0; |
|
488 |
break; |
|
489 |
||
490 |
default: |
|
491 |
aCode = aKeyEvent.iScanCode; // Use default code |
|
492 |
break; |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
493 |
} //switch |
37 | 494 |
|
495 |
__PHONELOG1( EBasic, EPhoneControl, |
|
496 |
"CPhoneKeyEventHandler::ConvertKeyCode aCode (%d)", aCode ); |
|
497 |
} |
|
498 |
||
499 |
// ----------------------------------------------------------------------------- |
|
500 |
// CPhoneKeyEventForwarder::IsKeyBlocked |
|
501 |
// ----------------------------------------------------------------------------- |
|
502 |
// |
|
503 |
TBool CPhoneKeyEventForwarder::IsKeyBlocked( const TKeyEvent& aKeyEvent ) const |
|
504 |
{ |
|
505 |
TBool ret = EFalse; |
|
506 |
||
507 |
// Check blocked keys |
|
508 |
const RArray<TInt>& keyScanCodeList = iStateMachine->State()->GetBlockedKeyList(); |
|
509 |
TInt count = keyScanCodeList.Count(); |
|
510 |
if( count ) |
|
511 |
{ |
|
512 |
for( TInt i = 0; i < count; i++ ) |
|
513 |
{ |
|
514 |
if( keyScanCodeList[i] == aKeyEvent.iScanCode ) |
|
515 |
{ |
|
516 |
ret = ETrue; |
|
517 |
} |
|
518 |
} |
|
519 |
} |
|
520 |
__PHONELOG1( EBasic, EPhoneControl, |
|
521 |
"CPhoneKeyEventHandler::IsKeyBlocked return (%d)", ret ); |
|
522 |
||
523 |
return ret; |
|
524 |
} |
|
525 |
||
526 |
// End of File |
|
527 |