Version: Smart Feature Phone 3.0

navigator.b2g.inputMethod

Description#

The InputMethod API enables the keyboard app to interact with the targeted input field.


Interfaces#

interface InputMethod {
Promise<boolean> setComposition(DOMString text);
Promise<boolean> endComposition(optional DOMString text);
Promise<boolean> sendKey(DOMString key);
Promise<boolean> keydown(DOMString key);
Promise<boolean> keyup(DOMString key);
/**
* Delete a text/node/selection before the cursor
*/
Promise<boolean> deleteBackward();
/**
* Select the <select> option specified by index.
* If this method is called on a <select> that support multiple
* selection, then the option specified by index will be added to
* the selection.
* If this method is called for a select that does not support multiple
* selection the previous element will be unselected.
*/
void setSelectedOption(long index);
/**
* Select the <select> options specified by indexes. All other options
* will be deselected.
* If this method is called for a <select> that does not support multiple
* selection, then the last index specified in indexes will be selected.
*/
void setSelectedOptions(sequence<long> indexes);
/**
* Remove focus from the current input, usable by Gaia System app, globally,
* regardless of the current focus state.
*/
void removeFocus();
};

Examples#

TBD