1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 1999-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
76 }; |
77 }; |
77 |
78 |
78 class TRepeatKey |
79 class TRepeatKey |
79 { |
80 { |
80 public: |
81 public: |
81 TKeyData iKey; |
82 TKeyEventRouterOutput iOutput; |
82 TInt iScanCode; |
83 TInt iInputScanCode; |
83 }; |
84 }; |
84 |
85 |
85 class CKeyboardRepeat : public CTimer |
86 class CKeyboardRepeat : public CTimer |
86 { |
87 { |
87 public: |
88 public: |
88 CKeyboardRepeat(); |
89 CKeyboardRepeat(); |
89 static void NewL(); |
90 static void NewL(); |
90 static void Destroy(); |
91 static void Destroy(); |
91 static void KeyDown(); |
92 static void KeyDown(); |
92 static void KeyUp(TInt aScanCode); |
93 static void KeyUp(TInt aScanCode); |
93 static TBool StartRepeat(const TKeyData &aKey, TInt aScanCode, CWsWindowGroup *aRepeatFocus, CWsCaptureLongKey* longCapture); |
94 static void StartRepeat(TInt aInputScanCode, const TKeyEventRouterOutput& aShortEvent, const TKeyEventRouterOutput* aLongEvent); |
94 static void CancelRepeat(CWsWindowGroup *aRepeatFocus); |
95 static void CancelRepeat(CWsWindowGroup *aRepeatFocus); |
95 static void CancelRepeat(CWsWindowGroup *aRepeatFocus,TUint aScanCode,TBool aLongCaptureFlag,TUint aModifiers=0); |
96 static void CancelRepeat(const TAny* aCaptureHandle, TBool aLongCaptureFlag); |
96 static void SetRepeatTime(const TTimeIntervalMicroSeconds32 &aInitialTime, const TTimeIntervalMicroSeconds32 &aTime); |
97 static void SetRepeatTime(const TTimeIntervalMicroSeconds32 &aInitialTime, const TTimeIntervalMicroSeconds32 &aTime); |
97 static void GetRepeatTime(TTimeIntervalMicroSeconds32 &aInitialTime, TTimeIntervalMicroSeconds32 &aTime); |
98 static void GetRepeatTime(TTimeIntervalMicroSeconds32 &aInitialTime, TTimeIntervalMicroSeconds32 &aTime); |
98 static inline TBool IsAreadyActive(); |
99 static inline TBool IsAreadyActive(); |
99 private: |
100 private: |
100 enum TRepeatType |
101 enum TRepeatType |
106 }; |
107 }; |
107 private: |
108 private: |
108 static void doCancelRepeat(); |
109 static void doCancelRepeat(); |
109 void RunL(); |
110 void RunL(); |
110 private: |
111 private: |
111 static CWsWindowGroup *iFocus; |
|
112 static CKeyboardRepeat *iThis; // Needed as CTimer derived parts can't be static |
112 static CKeyboardRepeat *iThis; // Needed as CTimer derived parts can't be static |
113 static TTimeIntervalMicroSeconds32 iInitialTime; |
113 static TTimeIntervalMicroSeconds32 iInitialTime; |
114 static TTimeIntervalMicroSeconds32 iTime; |
114 static TTimeIntervalMicroSeconds32 iTime; |
|
115 static TRepeatType iRepeating; |
115 static TRepeatKey iCurrentRepeat; |
116 static TRepeatKey iCurrentRepeat; |
116 static TRepeatType iRepeating; |
|
117 static TRepeatKey iAlternateRepeat; |
117 static TRepeatKey iAlternateRepeat; |
|
118 static TRepeatKey iLongRepeat; |
118 static TBool iAlternateRepeatExists; |
119 static TBool iAlternateRepeatExists; |
119 static CWsCaptureLongKey* iLongCapture; |
120 static CWsCaptureLongKey* iLongCapture; |
120 static TInt iRepeatRollover; |
121 static TInt iRepeatRollover; |
121 }; |
122 }; |
122 |
123 |
172 static void InitStaticsL(); |
173 static void InitStaticsL(); |
173 static void DeleteStatics(); |
174 static void DeleteStatics(); |
174 static CWsHotKey* ClearHotKeysL(TInt aHotKey); |
175 static CWsHotKey* ClearHotKeysL(TInt aHotKey); |
175 static void ResetDefaultHotKeyL(TInt aHotKey); |
176 static void ResetDefaultHotKeyL(TInt aHotKey); |
176 static void SetHotKeyL(const TWsClCmdSetHotKey &aHotKey); |
177 static void SetHotKeyL(const TWsClCmdSetHotKey &aHotKey); |
177 static void AddCaptureKeyL(const TCaptureKey &aCaptureKey); |
178 static void AddCaptureKeyL(const TKeyCaptureRequest& aRequest); |
178 static void SetCaptureKey(TUint32 aHandle, const TCaptureKey &aCaptureKey); |
179 static void UpdateCaptureKeyL(const TKeyCaptureRequest& aRequest); |
179 static void CancelCaptureKey(TUint32 aHandle); |
180 static void CancelCaptureKey(TKeyCaptureType aType, TAny* aHandle); |
180 static void ClientDestroyed(CWsClient *aClient); |
181 static void ClientDestroyed(CWsClient *aClient); |
181 static inline void AddToSwitchOnEventListL(const CWsWindowBase &aWindow, TEventControl aCircumstances); |
182 static inline void AddToSwitchOnEventListL(const CWsWindowBase &aWindow, TEventControl aCircumstances); |
182 static inline void RemoveFromSwitchOnEventList(const CWsWindowBase &aWindow); |
183 static inline void RemoveFromSwitchOnEventList(const CWsWindowBase &aWindow); |
183 static inline void AddToErrorMessageListL(const CWsWindowBase &aWindow, TEventControl aCircumstances); |
184 static inline void AddToErrorMessageListL(const CWsWindowBase &aWindow, TEventControl aCircumstances); |
184 static inline void RemoveFromErrorMessageList(const CWsWindowBase &aWindow); |
185 static inline void RemoveFromErrorMessageList(const CWsWindowBase &aWindow); |
205 static TBool SendDisplayChangedEvents(CWsClient *aWsClient, TInt aDisplayNumber, TInt aConfigurationChangeId, TInt aResolutionListChangeId); |
206 static TBool SendDisplayChangedEvents(CWsClient *aWsClient, TInt aDisplayNumber, TInt aConfigurationChangeId, TInt aResolutionListChangeId); |
206 static void SendScreenDeviceChangedEvents(CScreen* aScreen); |
207 static void SendScreenDeviceChangedEvents(CScreen* aScreen); |
207 static void SendScreenDeviceChangedEvent(const CWsWindowBase *aWindow); |
208 static void SendScreenDeviceChangedEvent(const CWsWindowBase *aWindow); |
208 static TBool ProcessErrorMessages(TWsErrorMessage::TErrorCategory aCategory, TInt aError); |
209 static TBool ProcessErrorMessages(TWsErrorMessage::TErrorCategory aCategory, TInt aError); |
209 static void NotifyOom(); |
210 static void NotifyOom(); |
210 static void QueueKeyPress(const TKeyData& aKey, TInt aScanCode, CWsWindowGroup* aRepeatFocus, TBool aCheckRepeat,TInt aRepeats); |
211 static void ProcessKeyPress(const TKeyEvent& aKeyEvent, TBool aCheckRepeat,TInt aRepeats); |
|
212 static void QueueKeyPress(const TKeyEventRouterOutput& aOutput, TBool aIsRepeat, TInt aRepeats); |
211 static void AddEventHandler(MEventHandler *aEventHandler, TBool aAdvancedPointersEnabled); |
213 static void AddEventHandler(MEventHandler *aEventHandler, TBool aAdvancedPointersEnabled); |
212 static void RemoveEventHandler(const MEventHandler *aEventHandler); |
214 static void RemoveEventHandler(const MEventHandler *aEventHandler); |
213 static void PotentialEventHandlerL(TInt aNum); |
215 static void PotentialEventHandlerL(TInt aNum); |
214 static TInt AddNotificationHandler(CAnim* aAnim, TUint32 aNotifications); |
216 static TInt AddNotificationHandler(CAnim* aAnim, TUint32 aNotifications); |
215 static void RemoveNotificationHandler(CAnim* aAnim); |
217 static void RemoveNotificationHandler(CAnim* aAnim); |
248 static TEventRequestQueue iFocusChangedQueue; |
250 static TEventRequestQueue iFocusChangedQueue; |
249 static TEventRequestQueue iGroupListChangedQueue; |
251 static TEventRequestQueue iGroupListChangedQueue; |
250 static TEventRequestQueue iScreenDeviceChangedQueue; |
252 static TEventRequestQueue iScreenDeviceChangedQueue; |
251 static TTime iPrevOomMessageTime; |
253 static TTime iPrevOomMessageTime; |
252 static CCaptureKeys *iCaptureKeys; |
254 static CCaptureKeys *iCaptureKeys; |
|
255 static CKeyEventRouter *iKeyEventRouter; |
|
256 static RLibrary iKeyEventRouterLibrary; |
253 static CWsHotKey *iHotKeys; |
257 static CWsHotKey *iHotKeys; |
254 static TInt iModifierState; |
258 static TInt iModifierState; |
255 static CRawEventReceiver *iEventReceiver; |
259 static CRawEventReceiver *iEventReceiver; |
256 static RArray<TRawEventHandler> iEventHandlers; |
260 static RArray<TRawEventHandler> iEventHandlers; |
257 static CArrayFixFlat<SNotificationHandler> *iNotificationHandlers; |
261 static CArrayFixFlat<SNotificationHandler> *iNotificationHandlers; |