Lens Scripting API

    The settings used for how the input keyboard should work.

    var options = new TextInputSystem.KeyboardOptions();
    options.enablePreview = false;
    options.keyboardType = TextInputSystem.KeyboardType.Text;
    options.returnKeyType = TextInputSystem.ReturnKeyType.Done;

    // Maintain the state of the keyboard
    options.onTextChanged = function(text, range) {
    currText = text;
    };

    // When the keyboard returns, print the current text
    options.onKeyboardStateChanged = function(isOpen) {
    if (!isOpen) {
    print(currText);
    }
    };

    script.createEvent("TapEvent").bind(function(){
    global.textInputSystem.requestKeyboard(options);
    })
    Index

    Constructors

    Properties

    enablePreview: boolean

    Sets whether a preview should be visible above the input keyboard.

    initialSelectedRange: vec2

    Initial selected text range to set on the inivisible text view.

    initialText: string

    Initial text to fill into the invisible text view.

    keyboardType: KeyboardType

    Requested keyboard type.

    onError: (error: number, description: string) => void

    Callback to be invoked when there is an error.

    onKeyboardStateChanged: (keyboardIsOpen: boolean) => void

    Callback to be invoked when keyboard is shown or dismissed.

    onReturnKeyPressed: () => void

    Callback to be invoked when the user presses the return key.

    onTextChanged: (text: string, range: vec2) => void

    Callback to be invoked every time the user presses a (non-return) key.

    returnKeyType: ReturnKeyType

    Requested return key type.

    MMNEPVFCICPMFPCPTTAAATR