kernel/eka/ewsrv/ky_tran.cpp
branchRCL_3
changeset 257 3e88ff8f41d5
parent 256 c1f20ce4abcf
equal deleted inserted replaced
256:c1f20ce4abcf 257:3e88ff8f41d5
     1 // Copyright (c) 1996-2010 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1996-2009 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 /**
    26 enum	{EDummy,EKeyDataConv,EKeyDataFunc,EKeyDataSettings};
    27 Ordinals of the functions which keymap dlls export.
    27   
    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 
       
    41 EXPORT_C CKeyTranslator* CKeyTranslator::New()
    28 EXPORT_C CKeyTranslator* CKeyTranslator::New()
    42 //
    29 //
    43 // Return the actual key translator
    30 // Return the actual key translator
    44 //
    31 //
    45     {
    32     {
   493 //
   480 //
   494 // Two classes that provide operations for accessing the keyboard configuration tables
   481 // Two classes that provide operations for accessing the keyboard configuration tables
   495 //
   482 //
   496 typedef void (*TLibFnDataConv)(SConvTable &aConvTable, TUint &aConvTableFirstScanCode,TUint &aConvTableLastScanCode,
   483 typedef void (*TLibFnDataConv)(SConvTable &aConvTable, TUint &aConvTableFirstScanCode,TUint &aConvTableLastScanCode,
   497 							   SScanCodeBlockList &aKeypadScanCode,SKeyCodeList &aNonAutorepKeyCodes);
   484 							   SScanCodeBlockList &aKeypadScanCode,SKeyCodeList &aNonAutorepKeyCodes);
   498 /**
   485 //
   499 Populates the object with conversion table data from aLibrary
       
   500 */
       
   501 void TConvTable::Update(RLibrary aLibrary)
   486 void TConvTable::Update(RLibrary aLibrary)
   502 #pragma warning (disable: 4705)
   487 #pragma warning (disable: 4705)
   503 	{
   488 	{
   504 #pragma warning (default: 4705)
   489 #pragma warning (default: 4705)
   505 	((TLibFnDataConv)aLibrary.Lookup(EKeyDataConv))(iConvTable,iFirstScanCode,iLastScanCode,iKeypadScanCodes,iNonAutorepKeyCodes);
   490 	((TLibFnDataConv)aLibrary.Lookup(EKeyDataConv))(iConvTable,iFirstScanCode,iLastScanCode,iKeypadScanCodes,iNonAutorepKeyCodes);
   539 // Convert the given aScanCode and aModifiers into a keyCode and aModifiers
   524 // Convert the given aScanCode and aModifiers into a keyCode and aModifiers
   540 	{
   525 	{
   541 	SConvKeyData returnVal;
   526 	SConvKeyData returnVal;
   542 	returnVal.keyCode=EKeyNull;
   527 	returnVal.keyCode=EKeyNull;
   543 	returnVal.modifiers=0;
   528 	returnVal.modifiers=0;
   544 	returnVal.filler = 0;
       
   545 
   529 
   546 	for (TUint i=0; i<iConvTable.numNodes; i++)
   530 	for (TUint i=0; i<iConvTable.numNodes; i++)
   547         {
   531         {
   548 		if (MatchesMaskedValue(aModifiers,iConvTable.pnodes[i].maskedModifiers))
   532 		if (MatchesMaskedValue(aModifiers,iConvTable.pnodes[i].maskedModifiers))
   549             {
   533             {