Boolean publishKeyboardMessage(Object data, [Array<String> instanceIds])
Object data parameter is the keyboard state payload sent to remote device(s). The
data Object has the following structure:
"key": <last_key>, "layoutType": <layout_type>}
data Object has the following properties:
Stringof the complete value of all keys typed on the keyboard onscreen.
keyCode– A special key code integer of the last key typed, including:
cursorPosition– An integer representing the zero-based offset of the cursor into the total string.
isKeyboardOnScreen– A Boolean that is
trueif the keyboard is currently on the Connected TV display, and
falseotherwise. This is only sent by the Engine and ignored if received from the remote device.
modifiers.control– A Boolean that is
trueif the control key is pressed, and
modifiers.shift– A Boolean that is
trueif the shift key is pressed, and
modifiers.alt– A Boolean that is
trueif the alt key is pressed, and
key– The character of the last key pressed. If the last key pressed was not a character, then the value is
nullor an empty string. In this case, the
keyCodeproperty should be populated.
layoutType– An integer which is
0for a QWERTY keyboard and
1for a PIN-entry keyboard.
If the optional parameter
instanceIds is specified,
the message should only be sent to the remote devices identified. No other devices receive the message. This parameter can
String for a single
null, the message is sent to all connected remote devices that are subscribed to keyboard messages.
true if sending the message is successful. Returns
Helper method to publish a keyboard message. Send the keyboard state to subscribed (or identified) devices so they can update
their keyboard displays.
When the remote device's keyboard changes, the app gets a notification via the
onKeyboardStateChanaged event callback.