|
1 /* |
|
2 * Copyright (c) 2002 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 * Provides the TAknFepInputStateInitialQwertyWesternPredictive methods. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 #include "AknFepUiInputStateInitialQwertyWesternPredictive.h" |
|
31 #include "AknFepUIManagerStateInterface.h" //MAknFepUIManagerStateInterface |
|
32 #include "AknFepManagerUIInterface.h" //MAknFepManagerUIInterface |
|
33 #include "AknFepManager.h" |
|
34 #include "AknFepCaseManager.h" //CAknFepCaseManager |
|
35 |
|
36 #include <PtiDefs.h> |
|
37 |
|
38 TAknFepInputStateInitialQwertyWesternPredictive:: |
|
39 TAknFepInputStateInitialQwertyWesternPredictive(MAknFepUIManagerStateInterface* aOwner) |
|
40 :TAknFepInputStateBase(aOwner) |
|
41 { |
|
42 } |
|
43 |
|
44 TBool TAknFepInputStateInitialQwertyWesternPredictive::HandleKeyL(TInt aKey, TKeyPressLength /*aLength*/) |
|
45 { |
|
46 MAknFepManagerUIInterface* fepMan = iOwner->FepMan(); |
|
47 CAknFepFnKeyManager::TFnKeyState fnKeyState = fepMan->FnKeyState(); |
|
48 |
|
49 switch (aKey) |
|
50 { |
|
51 case EStdKeyNull: |
|
52 // Take no action if simulated key ends up here |
|
53 break; |
|
54 |
|
55 case EStdKeySpace: //fall through |
|
56 { |
|
57 if (fnKeyState == CAknFepFnKeyManager::EFnKeyDown) |
|
58 { |
|
59 fepMan->LaunchSelectModeMenuL(); |
|
60 } |
|
61 else |
|
62 { |
|
63 _LIT(KSpace," "); |
|
64 fepMan->StartInlineEditL(); |
|
65 fepMan->UpdateInlineEditL(KSpace,0); |
|
66 fepMan->CommitInlineEditL(); |
|
67 return ETrue; |
|
68 } |
|
69 } |
|
70 case EStdKeyEnter: |
|
71 case EStdKeyTab: |
|
72 case EStdKeyBackspace: |
|
73 case EStdKeyLeftArrow: |
|
74 case EStdKeyRightArrow: |
|
75 case EStdKeyUpArrow: |
|
76 case EStdKeyDownArrow: |
|
77 { |
|
78 // Navigation keys do not activate the entry state. Instead they are handled by the editor directly. |
|
79 |
|
80 // Asyncronous case update is needed after the editor has handled the key |
|
81 fepMan->SimulateKeyEventL(EKeyF19); |
|
82 } |
|
83 break; |
|
84 // In case of Forward Deletion, we should not be doing anything |
|
85 case EStdKeyF21: |
|
86 case EKeyLeftShift: |
|
87 break; |
|
88 default: |
|
89 { |
|
90 // Most keys activate the entry state and are handled there |
|
91 fepMan->TryCloseUiL(); //expires the multitap timer |
|
92 iOwner->ChangeState(EEntry); |
|
93 fepMan->SendUIActivatedNotification(); |
|
94 } |
|
95 } |
|
96 |
|
97 return EFalse; |
|
98 } |
|
99 |
|
100 // End of file |