Note
This API has been available since API level 23.
This API has been available since API level 23.
IME and Virtual Keyboard Service.
This is a static service that starts with MaliitServer and provides access to the IME text field editor at a lower level than the VKB QML (since some languages have different VKBs).
For now, it primarily serves Second Screen, but it could provide other IME-related APIs in the future. The Second Screen functionality includes the ability to know when a text field is focused and the expected type of the input text, as well as inserting and replacing characters in the text field.
Text manipulation using this API is handled exclusively in Unicode characters. The encoding for LS2 is UTF-8, but length and count parameters should be based on Unicode characters. The manipulation is independent of language or keyboard layout.
API level 23
Name | Required | Type | Description |
---|---|---|---|
count | Required | number | Number of Unicode characters to delete. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | true if successful, false otherwise. |
errorText | Optional | String | Indicates the reason for the failure of the operation. |
errorCode | Optional | Number (int32_t) | Indicates the number for the failure of the operation. |
Example code
# luna-send -n 1 luna://com.webos.service.ime/deleteCharacters '{"count": 1}'
API level 23
Name | Required | Type | Description |
---|---|---|---|
text | Required | String | Text to insert. |
replace | Optional | Boolean | if true, replace any existing text in field. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | true if successful, false otherwise. |
errorText | Optional | String | Indicates the reason for the failure of the operation. |
errorCode | Optional | Number (int32_t) | Indicates the number for the failure of the operation. |
Example code
# luna-send -n 1 luna://com.webos.service.ime/insertText '{"text": "hello world", "replace": true}'
API level 23
Name | Required | Type | Description |
---|---|---|---|
subscribe | Required | Boolean | Must be true. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | true if successful, false otherwise. |
subscribed | Optional | Boolean | Subscribed to service. |
errorText | Optional | String | Indicates the reason for the failure of the operation. |
errorCode | Optional | Number (int32_t) | Indicates the number for the failure of the operation. |
Name | Required | Type | Description |
---|---|---|---|
focusChanged | Required | Boolean | true if a different text field was selected/focused |
currentWidget | Optional | object | An object with properties describing the current text field, including the boolean values "focus", "correctionEnabled", "predictionEnabled", "autoCapitalizationEnabled", "hiddenText", "hasSurroundingText", "hasSelection", and the integer values "cursorPosition" (Unicode offset of cursor) and "surroundingTextLength" (Unicode length of field contents, if available) |
Example code
# luna-send -n 1 luna://com.webos.service.ime/registerRemoteKeyboard '{"subscribe": true}'
API level 23
None
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | true if successful, false otherwise. |
Example code
# luna-send -n 1 luna://com.webos.service.ime/sendEnterKey '{}'
Contents