windowing/windowserver/nga/SERVER/CAPKEY.CPP
author hgs
Fri, 16 Jul 2010 11:45:55 +0300
changeset 116 171fae344dd4
parent 0 5d03bc08d59c
child 164 25ffed67c7ef
permissions -rw-r--r--
201026_3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
116
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
     1
// Copyright (c) 1995-2010 Nokia Corporation and/or its subsidiary(-ies).
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
// All rights reserved.
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
//
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
// Initial Contributors:
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
//
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
// Contributors:
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
//
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
// Description:
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
//
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
// Capture key & hot key classes
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
//
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
#include <e32std.h>
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
#include "server.h"
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
#include "windowgroup.h"
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
#include "EVENT.H"
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
#include "inifile.h"
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
_LIT(KWsProtectedKey, "PROTECTEDKEY");
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
_LIT(KWsProtectedWindowName, "PROTECTEDKEYWINDOWNAME");
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    27
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    28
/*CWsCaptureKey*/
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    29
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    30
CWsCaptureKey::CWsCaptureKey(CWsWindowGroup *aGroupWin) : CWsObject(aGroupWin?aGroupWin->WsOwner():NULL,WS_HANDLE_CAPTURE_KEY), iWindowGroup(aGroupWin)
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    31
	{}
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    32
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
CWsCaptureKey::~CWsCaptureKey()
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    34
	{
116
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    35
	TWindowServerEvent::CancelCaptureKey(ECaptureTypeKey, this);
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    36
	}
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
116
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    38
/**
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    39
Convert a window server key capture command to a capture request for the
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    40
key routing plug-in.
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    41
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    42
@param	aCaptureKey		Input capture command
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    43
@param	aRequest		Output capture request
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    44
*/
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    45
void CWsCaptureKey::CmdToRequest(const TWsWinCmdCaptureKey &aCaptureKey, TKeyCaptureRequest &aRequest)
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
	{
116
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    47
	aRequest.iType = ECaptureTypeKey;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    48
	aRequest.iModifierMask = aCaptureKey.modifierMask;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    49
	aRequest.iModifiers = aCaptureKey.modifiers;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    50
	aRequest.iInputCode = aCaptureKey.key;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    51
	aRequest.iOutputCode = aCaptureKey.key;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    52
	aRequest.iPriority = aCaptureKey.priority;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    53
	aRequest.iWindowGroup = iWindowGroup;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    54
	aRequest.iWindowGroupId = iWindowGroup ? iWindowGroup->Identifier() : 0;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    55
	aRequest.iAppUid = iWsOwner ? TUid::Uid(iWsOwner->SecureId().iId) : KNullUid;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    56
	aRequest.iHandle = this;
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    57
	}
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    58
116
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    59
/**
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    60
Check for protected key in a capture command
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    61
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    62
@param	aWindowGroup	Window Group of capture request
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    63
@param	aCaptureKey		Key capture command
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    64
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    65
@leave KErrPermissionDenied		Capture key is protected
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    66
*/
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    67
void CheckProtectedKeyL(CWsWindowGroup* aWindowGroup,const TWsWinCmdCaptureKey &aCaptureKey)
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    68
	{
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    69
	//The key specified in the WSINI file with the keyword: PROTECTEDKEY can only be captured 
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    70
	//by a group window with name specified with the PROTECTEDKEYWINDOWNAME keyword.
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    71
	TInt protectedKey;
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    72
	if(WsIniFile->FindVar(KWsProtectedKey,protectedKey))
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    73
		{
116
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    74
		if (aCaptureKey.key == static_cast<TUint>(protectedKey))
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    75
			{
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    76
			if (aWindowGroup->GroupName()==NULL)
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    77
				{
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    78
				User::Leave(KErrPermissionDenied);
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    79
				}
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    80
				
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    81
			TPtrC wsProtectedWindowName;
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    82
			WsIniFile->FindVar(KWsProtectedWindowName,wsProtectedWindowName);
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    83
			if (aWindowGroup->GroupName()->Find(wsProtectedWindowName)==KErrNotFound)
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    84
				{
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    85
				User::Leave(KErrPermissionDenied);
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    86
				}
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    87
			}
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    88
		}
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    89
	}
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    90
116
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    91
/**
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    92
Construct a capture object for normal key events and make a capture request
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    93
to the key routing plug-in.
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    94
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    95
@param	aCaptureKey		Key capture command from RWindowGroup::CaptureKey(),
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    96
						RWsSession::SetHotKey() or default hot key settings.
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
    97
*/
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    98
void CWsCaptureKey::ConstructL(const TWsWinCmdCaptureKey &aCaptureKey)
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    99
	{
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   100
	CheckProtectedKeyL(iWindowGroup, aCaptureKey);
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   101
	NewObjL();
116
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   102
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   103
	TKeyCaptureRequest request;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   104
	CmdToRequest(aCaptureKey, request);
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   105
	TWindowServerEvent::AddCaptureKeyL(request);
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   106
	}
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   107
116
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   108
/**
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   109
Make a capture request update for normal key events to the key routing plug-in.
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   110
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   111
@param	aCaptureKey		Key capture command from CWsHotKey::SetL()
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   112
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   113
Note: this function is used only to disable hot key capture requests or to
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   114
reset them to their defaults.
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   115
*/
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   116
void CWsCaptureKey::SetL(const TWsWinCmdCaptureKey &aCaptureKey)
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   117
	{
116
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   118
	TKeyCaptureRequest request;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   119
	CmdToRequest(aCaptureKey, request);
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   120
	TWindowServerEvent::UpdateCaptureKeyL(request);
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   121
	}
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   122
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   123
void CWsCaptureKey::CommandL(TInt , const TAny *)
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   124
	{
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   125
	}
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   126
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   127
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   128
/*CWsCaptureKeyUpsAndDowns*/
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   129
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   130
CWsCaptureKeyUpsAndDowns::CWsCaptureKeyUpsAndDowns(CWsWindowGroup *aGroupWin) : CWsObject(aGroupWin?aGroupWin->WsOwner():NULL,WS_HANDLE_CAPTURE_KEY_UPDOWNS), iWindowGroup(aGroupWin)
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   131
	{}
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   132
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   133
CWsCaptureKeyUpsAndDowns::~CWsCaptureKeyUpsAndDowns()
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   134
	{
116
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   135
	TWindowServerEvent::CancelCaptureKey(ECaptureTypeKeyUpDown, this);
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   136
	}
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   137
116
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   138
/**
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   139
Construct a capture object for up/down key events and make a capture request
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   140
to the key routing plug-in.
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   141
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   142
@param	aCaptureKey		Key capture command from
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   143
						RWindowGroup::CaptureKeyUpAndDowns().
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   144
*/
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   145
void CWsCaptureKeyUpsAndDowns::ConstructL(const TWsWinCmdCaptureKey &aCaptureKey)
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   146
	{
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   147
	CheckProtectedKeyL(iWindowGroup, aCaptureKey);
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   148
	NewObjL();
116
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   149
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   150
	TKeyCaptureRequest request;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   151
	request.iType = ECaptureTypeKeyUpDown;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   152
	request.iInputCode = aCaptureKey.key;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   153
	request.iOutputCode = aCaptureKey.key;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   154
	request.iModifiers = aCaptureKey.modifiers;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   155
	request.iModifierMask = aCaptureKey.modifierMask;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   156
	request.iPriority = aCaptureKey.priority;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   157
	request.iWindowGroup = iWindowGroup;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   158
	request.iWindowGroupId = iWindowGroup ? iWindowGroup->Identifier() : 0;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   159
	request.iAppUid = iWsOwner ? TUid::Uid(iWsOwner->SecureId().iId) : KNullUid;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   160
	request.iHandle = this;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   161
	TWindowServerEvent::AddCaptureKeyL(request);
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   162
	}
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   163
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   164
void CWsCaptureKeyUpsAndDowns::CommandL(TInt , const TAny *)
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   165
	{
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   166
	}
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   167
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   168
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   169
/*CWsCaptureLongKey*/
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   170
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   171
CWsCaptureLongKey::CWsCaptureLongKey(CWsWindowGroup *aGroupWin) 
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   172
	:CWsObject(aGroupWin?aGroupWin->WsOwner():NULL,WS_HANDLE_CAPTURE_LONG_KEY), iWindowGroup(aGroupWin)
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   173
	{}
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   174
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   175
CWsCaptureLongKey::~CWsCaptureLongKey()
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   176
	{
116
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   177
	TWindowServerEvent::CancelCaptureKey(ECaptureTypeLongKey, this);
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   178
	}
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   179
116
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   180
/**
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   181
Construct a capture object for long key events and make a capture request
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   182
to the key routing plug-in.
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   183
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   184
@param	aCaptureKey		Key capture command from RWindowGroup::CaptureLongKey()
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   185
*/
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   186
void CWsCaptureLongKey::ConstructL(const TWsWinCmdCaptureLongKey &aCaptureKey)
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   187
	{
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   188
	NewObjL();
116
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   189
	iFlags = aCaptureKey.flags;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   190
	iDelay = aCaptureKey.delay;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   191
	if (iDelay.Int() < 0)
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   192
		{
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   193
		TTimeIntervalMicroSeconds32 time;
116
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   194
		CKeyboardRepeat::GetRepeatTime(iDelay, time);
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   195
		}
116
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   196
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   197
	TKeyCaptureRequest request;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   198
	request.iType = ECaptureTypeLongKey;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   199
	request.iInputCode = aCaptureKey.inputKey;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   200
	request.iOutputCode = aCaptureKey.outputKey;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   201
	request.iModifiers = aCaptureKey.modifiers;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   202
	request.iModifierMask = aCaptureKey.modifierMask;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   203
	request.iPriority = aCaptureKey.priority;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   204
	request.iWindowGroup = iWindowGroup;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   205
	request.iWindowGroupId = iWindowGroup ? iWindowGroup->Identifier() : 0;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   206
	request.iAppUid = iWsOwner ? TUid::Uid(iWsOwner->SecureId().iId) : KNullUid;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   207
	request.iHandle = this;
171fae344dd4 201026_3
hgs
parents: 0
diff changeset
   208
	TWindowServerEvent::AddCaptureKeyL(request);
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   209
	}
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   210
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   211
void CWsCaptureLongKey::CommandL(TInt , const TAny *)
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   212
	{
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   213
	}