android.view.inputmethod.InputMethodSession |
Known Indirect Subclasses |
The InputMethodSession interface provides the per-client functionality of InputMethod that is safe to expose to applications.
Applications will not normally use this interface themselves, instead relying on the standard interaction provided by TextView and EditText.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
InputMethodSession.EventCallback |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Process a private command sent from the application to the input method.
| |||||||||||
This method is called when a key is pressed.
| |||||||||||
This method is called when there is a track ball event.
| |||||||||||
Called by a text editor that performs auto completion, to tell the
input method about the completions it has available.
| |||||||||||
This method is called when the application would like to stop
receiving text input.
| |||||||||||
Toggle the soft input window.
| |||||||||||
This method is called when cursor location of the target input field
has changed within its window.
| |||||||||||
Called by a text editor to report its new extracted text when its
contents change.
| |||||||||||
This method is called when the selection or cursor in the current
target input field has changed.
|
Process a private command sent from the application to the input method. This can be used to provide domain-specific features that are only known between certain input methods and their clients.
action | Name of the command to be performed. This must be a scoped name, i.e. prefixed with a package name you own, so that different developers will not create conflicting commands. |
---|---|
data | Any data to include with the command. |
This method is called when a key is pressed. When done with the event, the implementation must call back on callback with its result.
If the input method wants to handle this event, return true, otherwise return false and the caller (i.e. the application) will handle the event.
event | The key event. |
---|
This method is called when there is a track ball event.
If the input method wants to handle this event, return true, otherwise return false and the caller (i.e. the application) will handle the event.
event | The motion event. |
---|
Called by a text editor that performs auto completion, to tell the input method about the completions it has available. This can be used by the input method to display them to the user to select the text to be inserted.
completions | Array of text completions that are available, starting with the best. If this array is null, any existing completions will be removed. |
---|
This method is called when the application would like to stop receiving text input.
Toggle the soft input window. Applications can toggle the state of the soft input window.
showFlags | Provides additional operating flags. May be 0 or have the SHOW_IMPLICIT, SHOW_FORCED bit set. |
---|---|
hideFlags | Provides additional operating flags. May be 0 or have the HIDE_IMPLICIT_ONLY, HIDE_NOT_ALWAYS bit set. |
This method is called when cursor location of the target input field has changed within its window. This is not normally called, but will only be reported if requested by the input method.
newCursor | The rectangle of the cursor currently being shown in the input field's window coordinates. |
---|
Called by a text editor to report its new extracted text when its contents change. This will only be called if the input method calls InputConnection.getExtractedText() with the option to report updates.
token | The input method supplied token for identifying its request. |
---|---|
text | The new extracted text. |
This method is called when the selection or cursor in the current target input field has changed.
oldSelStart | The previous text offset of the cursor selection start position. |
---|---|
oldSelEnd | The previous text offset of the cursor selection end position. |
newSelStart | The new text offset of the cursor selection start position. |
newSelEnd | The new text offset of the cursor selection end position. |
candidatesStart | The text offset of the current candidate text start position. |
candidatesEnd | The text offset of the current candidate text end position. |