Resources | Resources |



IKeysMapping: interpreting key codes

Since extended keypad layouts are not standard, it is possible that a key combination may be interpreted differently on different handsets. For example, [Symbol] + [A] can mean # on one handset and * on another. Because applications are expected to be generic and not required to know the layout of the particular keypad of the mobile device on which they run, there must be a mechanism for the application to interpret a particular key combination.

To support this mechanism, Brew MP provides the IKeysMapping interface. Applications can call IKEYSMAPPING_GetMapping() to obtain the meaning of a virtual key code and a modifier flag(s) combination. The following example shows how an application would use this interface:

boolean App_HandleEvent(…)
   switch( eCode )
   case EVT_KEY:
   if ( dwParam )
      AECHAR mapping;
      if ( IKEYSMAPPING_GetMapping(pMe->pKeyMapping, wParam, dwParam, 
                                   &(mapping)) != SUCCESS )
         return FALSE;
         //Use mapping