kernel/eka/ewsrv/ky_tran.cpp
branchRCL_3
changeset 256 c1f20ce4abcf
parent 0 a41df078684a
child 257 3e88ff8f41d5
equal deleted inserted replaced
249:a179b74831c9 256:c1f20ce4abcf
     1 // Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1996-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 the License "Eclipse Public License v1.0"
     4 // under the terms of the License "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".
    21 #include <e32svr.h>
    21 #include <e32svr.h>
    22 #include <k32keys.h>
    22 #include <k32keys.h>
    23 #include <e32keys.h>
    23 #include <e32keys.h>
    24 #include <e32uid.h>
    24 #include <e32uid.h>
    25 
    25 
    26 enum	{EDummy,EKeyDataConv,EKeyDataFunc,EKeyDataSettings};
    26 /**
    27   
    27 Ordinals of the functions which keymap dlls export.
       
    28 
       
    29 @note These values depend on the ordering of the exports.
       
    30 If the existing def files were ever re-frozen, it would
       
    31 lead to a runtime error.
       
    32 */
       
    33 enum
       
    34 	{
       
    35 	EDummy,
       
    36 	EKeyDataConv, ///< Access conversion tables, signature TLibFnDataConv
       
    37 	EKeyDataFunc, ///< Access function tables, signature TLibFnDataFunc
       
    38 	EKeyDataSettings ///< Access data needed for control code entry @see TCtrlDigits, signature TLibFnDataSetting
       
    39 	};
       
    40 
    28 EXPORT_C CKeyTranslator* CKeyTranslator::New()
    41 EXPORT_C CKeyTranslator* CKeyTranslator::New()
    29 //
    42 //
    30 // Return the actual key translator
    43 // Return the actual key translator
    31 //
    44 //
    32     {
    45     {
   480 //
   493 //
   481 // Two classes that provide operations for accessing the keyboard configuration tables
   494 // Two classes that provide operations for accessing the keyboard configuration tables
   482 //
   495 //
   483 typedef void (*TLibFnDataConv)(SConvTable &aConvTable, TUint &aConvTableFirstScanCode,TUint &aConvTableLastScanCode,
   496 typedef void (*TLibFnDataConv)(SConvTable &aConvTable, TUint &aConvTableFirstScanCode,TUint &aConvTableLastScanCode,
   484 							   SScanCodeBlockList &aKeypadScanCode,SKeyCodeList &aNonAutorepKeyCodes);
   497 							   SScanCodeBlockList &aKeypadScanCode,SKeyCodeList &aNonAutorepKeyCodes);
   485 //
   498 /**
       
   499 Populates the object with conversion table data from aLibrary
       
   500 */
   486 void TConvTable::Update(RLibrary aLibrary)
   501 void TConvTable::Update(RLibrary aLibrary)
   487 #pragma warning (disable: 4705)
   502 #pragma warning (disable: 4705)
   488 	{
   503 	{
   489 #pragma warning (default: 4705)
   504 #pragma warning (default: 4705)
   490 	((TLibFnDataConv)aLibrary.Lookup(EKeyDataConv))(iConvTable,iFirstScanCode,iLastScanCode,iKeypadScanCodes,iNonAutorepKeyCodes);
   505 	((TLibFnDataConv)aLibrary.Lookup(EKeyDataConv))(iConvTable,iFirstScanCode,iLastScanCode,iKeypadScanCodes,iNonAutorepKeyCodes);
   524 // Convert the given aScanCode and aModifiers into a keyCode and aModifiers
   539 // Convert the given aScanCode and aModifiers into a keyCode and aModifiers
   525 	{
   540 	{
   526 	SConvKeyData returnVal;
   541 	SConvKeyData returnVal;
   527 	returnVal.keyCode=EKeyNull;
   542 	returnVal.keyCode=EKeyNull;
   528 	returnVal.modifiers=0;
   543 	returnVal.modifiers=0;
       
   544 	returnVal.filler = 0;
   529 
   545 
   530 	for (TUint i=0; i<iConvTable.numNodes; i++)
   546 	for (TUint i=0; i<iConvTable.numNodes; i++)
   531         {
   547         {
   532 		if (MatchesMaskedValue(aModifiers,iConvTable.pnodes[i].maskedModifiers))
   548 		if (MatchesMaskedValue(aModifiers,iConvTable.pnodes[i].maskedModifiers))
   533             {
   549             {