Help Center

Local Navigation

Object: TextEvent

Availability

BlackBerry® Device Software version 4.6 or later

Extends

UIEvent

The TextEvent object extends the UIEvent object and represents an event generated by entering characters using either the BlackBerry device or some other input source, such as a voice command. Unlike with KeyboardEvent objects, TextEvent objects can comprise multiple key presses, essentially creating an event after one or more characters have been entered.

To create an instance of a TextEvent, you must invoke Document.createEvent() with an input parameter of ”TextEvent”.

Text event types

Event type

Bubbles

Cancelable

Description

textInput

yes

yes

Occurs when one or more characters have been entered.

This event type includes the following context information:

TextEvent.data, UIEvent.view

TextEvent properties

Property name

Type

Description

Status

Support level

Availability

data

DOMString

Returns the value of the characters generated by the character device. The value of this property may be a single Unicode character or a sequence of Unicode characters. This property cannot be null or contain an empty string.

read only

DOM 3 Events

4.6 or later

TextEvent methods

Method name

Description

Support level

Availability

initTextEvent()

Initializes the value of a TextEvent.

DOM 3 Events

4.6 or later

initTextEventNS()

Initializes the value of a TextEvent with the given namespace URI.

DOM 3 Events

4.6 or later

Next topic: Object: UIEvent
Previous topic: MutationEvent methods

Was this information helpful? Send us your comments.