sl@0: // Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // Window server priority key queue handling sl@0: // sl@0: // sl@0: sl@0: #include "PRIKEY.H" sl@0: sl@0: sl@0: CPriorityKey::CPriorityKey(CWsClient *aOwner) : CEventBase(aOwner) sl@0: { sl@0: __DECLARE_NAME(_S("CPriorityKey")); sl@0: } sl@0: sl@0: void CPriorityKey::PriorityKey(TInt aHandle, const TKeyData &aKey, TInt aScanCode) sl@0: // sl@0: // Called when a priority key is pressed sl@0: // sl@0: { sl@0: if (!iEventMsg.IsNull()) sl@0: { sl@0: iPriorityKeyHandle=aHandle; sl@0: iPriorityKey=aKey; sl@0: iScanCode=aScanCode; sl@0: SignalEvent(); sl@0: } sl@0: } sl@0: sl@0: void CPriorityKey::GetData() sl@0: // sl@0: // If there is an outstanding abort event in the queue, reply with it's data, else send a null abort event sl@0: // sl@0: { sl@0: TWsPriorityKeyEvent event; sl@0: TKeyEvent *key=event.Key(); sl@0: key->iScanCode=iScanCode; sl@0: key->iCode=iPriorityKey.iKeyCode; sl@0: key->iModifiers=iPriorityKey.iModifiers; sl@0: key->iRepeats=0; sl@0: event.SetHandle(iPriorityKeyHandle); sl@0: CEventBase::GetData(&event,sizeof(event)); sl@0: iPriorityKeyHandle=0; sl@0: } sl@0: sl@0: TPriorityKey::TPriorityKey(TUint aKeycode,TUint aModifierMask,TUint aModifiers,TPriorityKey *aPriorityKeys) : sl@0: iNext(aPriorityKeys), sl@0: iKeyCode(aKeycode), sl@0: iModifiers(aModifiers), sl@0: iModifierMask(aModifierMask) sl@0: {} sl@0: sl@0: TInt TPriorityKey::Equals(TUint aKeycode,TUint aModifierMask,TUint aModifiers) sl@0: { sl@0: return(iKeyCode==aKeycode && iModifierMask==aModifierMask && iModifiers==aModifiers); sl@0: } sl@0: sl@0: TInt TPriorityKey::KeyMatches(const TKeyData &aKey) sl@0: { sl@0: return(iKeyCode==aKey.iKeyCode && (iModifierMask&aKey.iModifiers)==iModifiers); sl@0: }