Update contrib.
1 // Copyright (c) 1996-2010 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Window server priority key queue handling
21 CPriorityKey::CPriorityKey(CWsClient *aOwner) : CEventBase(aOwner)
23 __DECLARE_NAME(_S("CPriorityKey"));
26 void CPriorityKey::PriorityKey(TInt aHandle, const TKeyEvent &aKeyEvent)
28 // Called when a priority key is pressed
31 if (!iEventMsg.IsNull())
33 iPriorityKeyHandle=aHandle;
34 iPriorityKey = aKeyEvent;
39 void CPriorityKey::GetData()
41 // If there is an outstanding abort event in the queue, reply with it's data, else send a null abort event
44 TWsPriorityKeyEvent event;
45 *event.Key() = iPriorityKey;
46 event.Key()->iRepeats = 0;
47 event.SetHandle(iPriorityKeyHandle);
48 CEventBase::GetData(&event,sizeof(event));
52 TPriorityKey::TPriorityKey(TUint aKeycode,TUint aModifierMask,TUint aModifiers,TPriorityKey *aPriorityKeys) :
55 iModifiers(aModifiers),
56 iModifierMask(aModifierMask)
59 TInt TPriorityKey::Equals(TUint aKeycode,TUint aModifierMask,TUint aModifiers)
61 return(iKeyCode==aKeycode && iModifierMask==aModifierMask && iModifiers==aModifiers);
64 TInt TPriorityKey::KeyMatches(const TKeyEvent &aKeyEvent)
66 return(iKeyCode == aKeyEvent.iCode && (iModifierMask & aKeyEvent.iModifiers) == iModifiers);