onKeyboardWillShow(listener: Function)

Requires:
BaseKit≥3.6.6@ray-js/ray≥1.5.30
Platforms:
iOSAndroid
import { onKeyboardWillShow } from '@ray-js/ray';

// Promise usage
try {
  const res = await onKeyboardWillShow({ ...params });
  console.log(res);
} catch (err) {
  console.log(err.errorMsg);
}

Description

Keyboard pop-up

Parameters

ParameterTypeRequiredDescription
Yes

Return Value

None

Examples

import { onKeyboardWillShow, scanCode } from '@ray-js/ray'

// Register the keyboard show event and use scanCode's keyboard input mode to bring up the system keyboard.
// Passing isShowKeyboard: true to scanCode provides a "Keyboard input" entry on the scan page; after entering, the input field auto-focuses to show the system keyboard, triggering onKeyboardWillShow.
onKeyboardWillShow(e => {
  console.log("[onKeyboardWillShow]", e);
});

scanCode({
  onlyFromCamera: false,
  isShowKeyboard: true,
  keyboardBean: { title: "Keyboard input" },
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});