Input Modes

Input modes enable apps to request that a MIDP implementation make it convenient for the user to enter certain characters. For example, an app may have a text field or text box that has a NUMERIC constraint. To make data entry more convenient, the app could also request an input mode that makes it easy for the user to enter numbers. Each input mode has a name, which typically describes its character set. An app requests an input mode by name. For example, the app could request an input mode of IS_LATIN_DIGITS to make it more convenient for the user to enter a number.

MIDP Implementors

Strongly Recommend: Java graphics bulb1_icon.gif Indicate the device's current text mode to the user. Screenshot shows two text modes, one numeric and one alphabetic, and points out the device's text input mode indicators.

Screenshot Input Mode Indicators

Java graphics 06fig07.gif


Possible input modes include unicode character blocks, as defined in the J2SE platform's java.lang.Character.UnicodeBlock class (such as UCB_BENGALI), and input subsets as defined in the J2SE platform's java.awt.im.InputSubset class (such as IS_LATIN_DIGITS). In addition, MIDP defines MIDP_UPPERCASE_LATIN, the subset of IS_LATIN that corresponds to uppercase Latin letters, and MIDP_LOWERCASE_LATIN, the subset of IS_LATIN that corresponds to lowercase Latin letters. Implementations can also create character subsets; see the MIDP 2.0 Specification [19] for more information.

Strongly Recommend: Java graphics bulb1_icon.gif Decide which input modes you will support, and publish them.

Strongly Recommend: Java graphics bulb1_icon.gif If you are unable to fulfill an app's input mode request, or the input mode is inconsistent with the text box or text field's current constraint setting, use a default input mode instead.

Recommend: Java graphics bulb2_icon.gif Change your default input mode according to the constraints of the text box or text field. For example, if the current constraint is NUMERIC, you could use a default input mode that makes it easy for the user to enter numerals, whereas if the constraint is ANY, your default input mode might allow the characters corresponding to the device's locale.

Requesting an Input Mode

app Developers

Recommend: Java graphics bulb2_icon.gif Request an input mode before the text box or text field is visible. If editing is already in progress, your request will not change the current input mode; it will take effect the next time the user initiates editing of this text object.

MIDP Implementors

Strongly Recommend: Java graphics bulb1_icon.gif Use the requested input mode, if possible, whenever the user initiates the editing of a text box or text field, but allow the user to switch input modes at any time. Users must be permitted to enter any character that is allowed within the constraints of the text box or text field.

Strongly Recommend: Java graphics bulb1_icon.gif If an app uses constraints and modifiers that conflict with its requested input mode, you must honor the constraints and modifiers. You are permitted to ignore the input mode in order to fulfill the requirements of the constraints and modifiers.

Providing Symbols Not on the Device

MIDP Implementors

Consider: Use a symbol table to show extra symbols that are not easily available from the device. If the device already has such a symbol table, consider giving the users access to it. Screenshot shows a symbol table.

Screenshot Symbol Table for Entering Characters

Java graphics 06fig08.gif




   
Comments