Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 10:40, 24 August 2007.

TSS000415 - Mapping of physical keys across language variants

From Forum Nokia Wiki


Subject:

Mapping of physical keys across language variants TSS000415

 

Platform(s): Device(s), SW version(s):
S60 3rd Edition, S60 3rd Edition FP1  

Category:

Symbian C++

Subcategory:

UI
Localization

Description:

Overview:
It is a common requirement for applications to be independent of language variants. This requires mapping of physical keys to logical keys. The mapping is language dependent. Note that all FEP-aware controls, such as standard S60 UI (Avkon) editors, take care of this mapping automatically. However, if the application needs to accept text input by handling individual key events, key mapping for different language variants may cause problems, especially in S60 devices that feature a QWERTY keyboard (Nokia E61, Nokia E70).
Solution:
CPtiEngine class can be used for resolving the correct mapping for each key. Required header files, PtiEngine.h and PtiKeyMappings.h, are available in the SDK from S60 3rd Edition onwards.
Important classes in this API are CPtiEngine, CPtiCoreLanguage, TPtiKey, and CPtiQwertyKeyMappings.
Below is a simplified example for getting the key mapping for a particular scan code:
    CPtiEngine *iEngine;
    CPtiCoreLanguage* iCoreLanguage;    
    CPtiKeyMappings* iPtiKeyMappings;
    CPtiQwertyKeyMappings* iQwertyKeyMappings;
    TBuf<50> iResult;
    ...
    // Get the current language
    TLanguage lang = User::Language();
    // scan code of the key you are interested in
    TPtiKey key = (TPtiKey)aScanCode;
    TPtiTextCase case = EPtiCaseLower;
    // Instantiate the engine
    iEngine = CPtiEngine::NewL(ETrue);
        // Make a language object based on current language
    iCoreLanguage =
        static_cast<CPtiCoreLanguage*>(
            iEngine->GetLanguage(lang));
    // Get the keyboard mappings for the language
    iQwertyKeyMappings =
        static_cast<CPtiQwertyKeyMappings*>(
            iCoreLanguage->GetQwertyKeymappings());
    // Finally, get mapping for a particular key.
    iQwertyKeyMappings->GetDataForKey(
        key, iResult, case);
    // iResult now contains the correct mapping
    // for the key

Creation date:

September 21, 2006

Last modified:

-
Related Discussions
Thread Thread Starter Forum Replies Last Post
Messages with more than 160 chars Lukas Hetzenecker Python 14 2007-10-15 17:24
ELeftSoftKey Mapping cs_lcmaa Symbian Tools & SDKs 1 2003-04-15 09:25
Any APIs to configurate multimedia key's setting? bibu2651 General Symbian C++ 3 2006-11-23 11:15
arrow keys for UP & DOWN navigation tenren Mobile Java General 1 2006-07-19 11:56
bad content encountered: error sash_mca Browsing and Mark-ups 3 2003-05-14 06:13
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZKnowledgeBaseContentQ
     qfnZtypeQUqfnTypeZTechnicalSolutionQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX