Keyboard

Virtual keyboard

It relies on TCGSDK. We recommend you use it in the callback function onConnectSuccess in TCGSDK.init.

Constructor

new Keyboard(params)

OnTouchEventResponseļ¼š

Name Type Description
type string The event type, which is read-only. Valid values: touchstart, touchend, touchcancel.
key string The key of the key, which is read-only.
code string The code of the key, which is read-only.
Example
new Keyboard({});
Parameters:
Name Type Description
params Object
Properties
Name Type Attributes Default Description
zone HTMLElement <optional>
TCGSDK init param `mount`

The keyboard mount node. Default value: TCGSDK init param mount.

sendData boolean <optional>
true

Whether to send the keyboard data automatically. Default value: true.

keyBorderColor string <optional>
'#4a525a'

The frame color of a key. Default value: #4a525a.

keyPressedBorderColor Object <optional>
'#2684FF'

The frame color of a pressed key. Default value: #2684FF

onTouchEvent function <optional>

Keyboard OnTouchEventResponse

Methods

show() → {void}

This API is used to display the virtual keyboard.

Returns:
Type
void

hide() → {void}

This API is used to hide the virtual keyboard.

Returns:
Type
void

destroy() → {void}

This API is used to terminate the virtual keyboard and delete the corresponding node (to use the virtual keyboard again, you need to create a new one).

Returns:
Type
void