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

Developer

resources

IKeysConfig: querying and setting sticky keys

The IKeysConfig interface can be used to query and set the state of sticky keys on a mobile device handset.

Note: OEMs are still expected to include sticky keys as modifiers in EVT_KEY events as explained in the topic Porting extended keypads. IKeysConfig does not replace that requirement.

This interface can be used by applications to get and set the state of sticky keys, such as CAPS LOCK, SCROLL LOCK, and NUM LOCK, which turn on when pressed once, and then get added as a modifier to every key event until they are turned off.

Note: Note that OEMKeysMapping.c contains the implementations of two interfaces, IKeysMapping and IKeysConfig.

There is no reference implementation for either of these interfaces.; the interface implementation in OEMKeysMapping.c contains stubs that you must implement to support this interface.

To port IKeysConfig:

  • Uncomment these lines in your OEMFeatures.h file:

    #define FEATURE_EXTENDED_KEYS

    #define FEATURE_KEYS_CONFIG

  • These functions need to be implemented in OEMKeysMapping.c. They are stubs in the provided reference file.

    The following call should return a mask of available sticky keys on the handset. For example, if the handset offers Caps Lock and Num Lock sticky keys, set *pdwKeys to KB_CAPSLOCK | KB_NUMLOCK.

    static int IKeysConfig_GetStickyKeys(IKeysConfig *pme, uint32 *pdwKeys)

    The following call should return the current state of the sticky key being queried. Return TRUE in *pbState if the CAPSLOCK key is currently active (where dwKey is set to KB_CAPSLOCK). Return FALSE otherwise. If the dwKey that is passed in is not a valid sticky key, return AEE_EFAILED from the function.

    static int IKeysConfig_GetKeyState(IKeysConfig *pme, uint32 dwKey, boolean *pbState)

    The following function should set the state of the sticky key passed in dwKey to the requested state (If bState is TRUE, turn the sticky key ON, else turn it OFF). Return EFAILED if the operation is not supported for the passed-in key or if the operation fails for some other reason.

    static int IKeysConfig_SetKeyState(IKeysConfig *pme, uint32 dwKey, boolean bState)