Skip to main content

Keyboard

Class: ScreenBoard.

Adaptive on-screen keyboard with a couple of supported languages.

Keybaord preview

page/index.js
import { ScreenBoard } from "mzfw/device/ScreenBoard";

Page({
build() {
const board = new ScreenBoard({});
board.onConfirm = (value) => {
console.log("confirm clicked:", value);
};
board.visible = true;
}
})

Compatibility

All ZeppOS devices are supported.

Features

Reference

new ScreenBoard(options)

Create a new ScreenBoard instance with provided options.

options is an object that may contain following properties:

  • theme: UiTheme: theme that will be used for keyboard design & sizing;
  • forceRenderer: string: force set renderer ID, may be t9, t14 or qwerty;
  • forceLayouts: string[]: force set keyboard layout IDs.

title: string

Property. Text that will be displayed when value is empty.

confirmButtonText: string

Property. Text shown on confirm button bellow the keyboard.

visible: boolean

Property. If set to true, keyboard will be rendered and shown. If false (default), it will be hidden

value: string

Property. Current keyboard screen value.

onConfirm(value: string): any

Method. Will be called when user click to confirm button bellow the keyboard. Can be overridden.