Resources | Resources |



Porting instructions for key codes

This section outlines all the porting steps required to support this feature.

Note: You need to enable FEATURE_KEYS_MAPPING in pk\inc\OEMFeatures.h to support this feature.

To send key events

  1. Send key events to Brew MP as described in the Standardizing key events topic. For each alphabet key or modifier, call AEE_Event with EVT_KEY_PRESS, EVENT_KEY, and EVT_KEY_RELEASE.

    Note: The standard AEE_KeyPress, AEE_Key, AEE_KeyRelease macros cannot be used here because you may need to specify the dwParam modifier to the key event.

  2. For character keys on extended keypads that do not have standard Brew MP AVK codes, such as keys for single quotes or commas, make sure the parameter to the AEE_Key macros is the Unicode value of the non-shift character on that key (the character that is meant when the key is pressed by itself without any modifiers).
    • For example, if the OEM has a key that has two characters on it, semi-colon (;) and colon (:).
    • Semi-colon is the main character on the key; it is the character meant when this key is pressed by itself. When this key is pressed, the parameter to the AEE_Key macros should be the Unicode value of the semi-colon character (59 decimal).
    • The same rules apply if the key is pressed with the shift key. In this case, the application will get EVT_KEY events with wParam = 59 and dwParam containing KB_LSHIFT or KB_RSHIFT.
    • Then, when the application calls IKEYSMAPPING_GetMapping(), it should get the Unicode value of colon (58 decimal)
    • To support this, the IKeysMapping.ini file should have mappings like this:
      • ‘;’ + KB_LSHIFT = ‘:’ // Semicolon key is overloaded
      • ‘;’ + KB_RSHIFT = ‘:’

To parse the IKeysMapping.ini file

Follow these steps to create a mappings file for IKeysMapping:

  1. Create the KeysMapping.ini file following the guidelines in the topic IKeysMapping: interpreting key codes.
  2. Use the PK\Utils\KeysMappingparser.exe utility to generate the map.csv file. See the "Example usage of the parsekeysmapping utility" below.
  3. The utility requires the Brew MP SDK AEEVCodes.h file to create the map.csv file. It looks for this file using the BREWDIR environment variable. You should set BREWDIR to the SDK directory of the Brew MP version for your handset. It is also possible to specify the AEEVCodes.h file that should be used via the –vc command-line switch.

Example usage of the keysmappingparser utility

C:\BREW\PK\utils> keysmappingparser

C:\BREW\PK\utils> keysmappingparser –k C:\mapping\IKeysMapping.ini

C:\BREW\PK\utils> keysmappingparser –k C:\mapping\km.ini –vc AEEVCodes.h

The first example (without any parameters) looks for IKeysMapping.ini in the current folder and AEEVCodes.h in the BREWDIR\inc folder.

The second example looks for IKeysMapping.ini in the specified location and AEEVCodes.h in the BREWDIR\inc folder.

The third example looks for c:\mapping\km.ini as the Keys mapping file and AEEVCodes.h in the current folder (the folder in which the utility is run).

The end result of this step is the map.csv file that is generated by the utility. The file is generated in the directory from which the tool is run.