Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Integrating IKeysMapping and IKeysConfig

This section describes how to integrate support for the IKeysMapping and IKeysConfig interfaces.

For Brew MP 1.0.2 AMSS, the IKeysMapping interface is built statically in the AMSS build.

For Brew MP 1.0.3 and 1.0.4 AMSS, the IKeysMapping interface is implemented in the dynamic module brewmp_keysmapping.mod1. This dynamic module is expected to be integrated on the device for supporting extended keypads.

To customize the mappings returned by IKeysMapping, OEMs are expected to provide this interface with the mapping of each legal AVK + modifier combination with its mapping on the device. This mapping is to be provided in the form of a processed mappings file (map.csv). This file can be generated from the keysmappingparser.exe tool, which can be found in the Brew MP toolset .

You can also find keysmappingparser.exe in Brew MP 1.0.3 and 1.0.4 AMSS build

The keysmappingparser.exe tool expects a mappings file, usually called keysmapping.ini. The keysmapping.ini file should define all the keys with modifiers, including all 26 Latin characters (lower case to upper case) and contain one line per mapping.

Note: OEMs should have mappings for both left and right modifiers, for example:

AVK_A + KB_LSHIFT = A and AVK_A + KB_RSHIFT = A

The format of each line in this file is of the form:

 [ AVK_VALUE] + [MODIFIERS] = [MAPPING]

Some examples are shown below:

AVK_A + KB_LSHIFT = ‘A’
AVK_A + KB_RSHIFT = ‘A’ // Need to specify each mapping
AVK_A + KB_SYMBOL = ‘#’
AVK_A + KB_LALT | KB_LSHIFT = 0xA9 // Pressing ALT + SHIFT + A means ©

The mappings file is free-form, and the format supports mappings to be entered in hexadecimal for hard to type characters as shown in one of the examples above. C++ style single line comments are also supported.

After the file is generated, it needs to be parsed into a form suitable for the IKeysMapping interface using the keysmappingparser tool. This tool generates a map.csv file, which is a parsed version of keysmapping.ini. keysmappingparser.exe is located in the bin folder of the Brew MP Toolset

Following are instructions for using keysmappingparser.exe:

  1. Create the keysmapping.ini file following the guidelines above.
  2. Use keysmappingparser.exe tool to generate the map.csv file.
  3. The keysmappingparser.exe requires the BMP SDK AEEVCodes.h system header file to create the map.csv file. It looks for this file using the BREWMPSDK environment variable. It is also possible to specify the AEEVCodes.h file that should be used via the -vc command line switch.

Examples

Example 1:

 %BREWMP_PLATFORM%\bin > keysmappingparser

In this example, keysmappingparser looks for keysmapping.ini in the current folder and \AEEVCodes.h in the %BREWMP_PLATFORM%\system\inc folder.

Example 2:

 %BREWMP_PLATFORM%\bin > keysmappingparser -k
C:\mapping\ keysmapping.ini

In this example, keysmappingparser looks for keysmapping.ini in the specified location and AEEVCodes.h in the %BREWMP_PLATFORM%\\system\inc folder.

Example 3:

%BREWMP_PLATFORM%\bin > keysmappingparser -k
C:\mapping\km.ini -vc AEEVCodes.h

In this example, keysmappingparser uses "c:\mapping\km.ini" as the Keys mapping file, and looks for AEEVCodes.h in the current folder (the folder in which the keysmappingparser is run).

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

OEMs should load the map.csv file onto the handset. To point out the correct location to the interface, the following ISettings keys need to be updated in the .ini file in the keysmapping folder.

  • For 1.0.2, where the feature is statically built in AMSS, the ini file is named keysmapping.ini
  • For 1.0.3 and 1.04, where the feature is dynamically built in brewmp_keysmapping.mod1, the ini file is named kmsettings.ini

Note: This keysmapping.ini file should not be confused with the keysmapping.ini file used for generating map.csv. This keysmapping.ini file is a settings store for keysmappings ISettings items. The settings file is renamed to kmsettings.ini in 1.0.3+.

The ISettings keys that need to be updated in the corresponding ini files are shown in bold:

[extended_keypad]
 present=1
[mapfile]
 location=fs:/map.csv

This location can be anywhere the OEM chooses. It should use a BMP canonical path (starting with fs:/).

IKeysConfig is also implemented by brewmp_keysmapping.mod1. The only piece of information required by the IKeysConfig interface is the list of sticky keys on the handset. These are also specified by changing the corresponding setting in kmsettings.ini for 1.0.3 and 1.04, and keysmapping.ini for 1.0.2:

[sticky_keys]
 list=KB_CAPSLOCK,KB_NUMLOCK