net.rim.device.api.ui
Class KeypadUtil

java.lang.Object
  extended by net.rim.device.api.ui.KeypadUtil

public class KeypadUtil
extends Object

Provides keypad utility functionality.

See Also:
Keypad
Since:
BlackBerry API 4.1.0

Field Summary
static int MODE_EN_LOCALE
          Use this constant to specify that keys conversion should occur according to English locale
static int MODE_UI_CURRENT_LOCALE
          Use this constant to specify that keys conversion should occur according to current UI system locale
 
Method Summary
static char getKeyChar(int keycode, int mode)
          Retrieves character matching specified key from the keymap than corresponds to current system UI locale.
static int getKeyCode(char ch, int status, int mode)
          Performs reverse lookup of key code that corresponds to given char and status.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

MODE_UI_CURRENT_LOCALE

public static final int MODE_UI_CURRENT_LOCALE
Use this constant to specify that keys conversion should occur according to current UI system locale

See Also:
KeypadUtil.getKeyChar(int keycode, int mode), KeypadUtil.getKeyCode(char ch, int status, int keycode), Constant Field Values
Since:
BlackBerry API 4.1.0

MODE_EN_LOCALE

public static final int MODE_EN_LOCALE
Use this constant to specify that keys conversion should occur according to English locale

See Also:
KeypadUtil.getKeyChar(int keycode, int mode), KeypadUtil.getKeyCode(char ch, int status, int keycode), Constant Field Values
Since:
BlackBerry API 4.1.0


Method Detail

getKeyChar

public static char getKeyChar(int keycode,
                              int mode)
Retrieves character matching specified key from the keymap than corresponds to current system UI locale. If there more then one character that corresponds to given key than first character is provided.

Invoke this method to retrieve a specific character from keymap associated with current UI locale, given a particular key and status value.

Parameters:
key - Key and Status composition. This kind of composed key code used in Field event loop callback methods. To extract key or status portions use Keypad.key(int keycode) and Keypad.status(int keycode)methods
mode - Identifies type of data used for keys conversion. Can be one of KeypadUtil.MODE_UI_CURRENT_LOCALE and KeypadUtil.MODE_EN_LOCALE constants.
Returns:
Character in keymap associated with keycode.
See Also:
KeypadUtil.getKeyCode(char ch, int status, int keycode)
Since:
BlackBerry API 4.1.0

getKeyCode

public static int getKeyCode(char ch,
                             int status,
                             int mode)
Performs reverse lookup of key code that corresponds to given char and status. This can be used in Field.keyChar(char character, int status, int time) event callbacks to obtain original keycode.

Parameters:
ch - Key Char that would be generated with specified conversion data(mode) for resulting keycode
status - Status value for key
mode - Identifies type of data used for keys conversion. Can be one of KeypadUtil.MODE_UI_CURRENT_LOCALE and KeypadUtil.MODE_EN_LOCALE constants.
Returns:
Keycode Key and Status composition that corresponds to given char and status
See Also:
KeypadUtil.getKeyChar(int keycode, int mode)
Since:
BlackBerry API 4.1.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal