TextFieldInputMode

Since: BlackBerry 10.0.0

#include <bb/cascades/TextFieldInputMode>

Represents a text input mode for the TextField.

The TextFieldInputMode determines how the TextField behaves in relation to its text input. Each input mode has a default set of properties that specify what symbols appear on the keyboard and how the input is displayed in the field. For example, the Chat mode contains functionality that allows users to specify emoticons that can be rendered on the screen.

You can change the default properties for each mode by turning them on or off using TextContentFlag and TextInputFlag.

If the TextFieldInputMode::Custom mode is set, no TextInputFlag values will be available except for TextInputFlag::VirtualKeyboard and TextInputFlag::VirtualKeyboardOff.

For a TextArea, you must use TextAreaInputMode.


Overview

Public Types

Type

Text input modes for a TextField.

Since:

BlackBerry 10.0.0

Default

The default text input mode.

Text

An input mode for plain text.

Since:

BlackBerry 10.0.0

EmailAddress

An input mode for email addresses.

Since:

BlackBerry 10.0.0

Password

An input mode for passwords.

Since:

BlackBerry 10.0.0

Chat

An input mode for chat conversations.

Since:

BlackBerry 10.0.0

Url

An input mode for URLs.

Since:

BlackBerry 10.0.0

PhoneNumber

An input mode for phone numbers.

Since:

BlackBerry 10.0.0

NumbersAndPunctuation

An input mode for numbers and punctuation.

Since:

BlackBerry 10.0.0

NumericPassword

An input mode for numeric passwords.

Since:

BlackBerry 10.0.0

Pin

An input mode for a device PIN.

A PIN is a unique identifier for a device.

Since:

BlackBerry 10.0.0

Custom

An input mode for custom input.

Custom input mode will ignore all key input. Key events have to be handled by the application.

For text editing, you could use the @ TextEditor class to add text and maintain the cursor position. If the application uses TextField::setText(), the cursor position will be reset.

When Custom input mode is set, only the TextInputFlag::VirtualKeyboard and TextInputFlag::VirtualKeyboardOff values are available. The other flags in TextInputMode must not be altered from the default state. Spell checking and features from the Input Method Framework, such as word prediction, will be disabled. The application could implement its own integration with the Input Method Framework if such features are required.

When Custom input mode is set, the TextField will also not handle submit keys or keyboard shortcuts.

Since:

BlackBerry 10.2.0

Last modified: 2014-06-24



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus