Preparing search index...

    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.

    Lens Scripting Version 165

    false
    
    initialSelectedRange: vec2

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

    Lens Scripting Version 165

    (0, 0)
    
    initialText: string

    Initial text to fill into the invisible text view.

    Lens Scripting Version 165

    ""
    
    keyboardType: KeyboardType

    Requested keyboard type.

    Lens Scripting Version 165

    TextInputSystem.KeyboardType.Text
    
    onBeginBatchEdit: () => void

    Callback to be invoked when a batch edit session is started. Editors can't send any update to the keyboard during a batch edit session.

    Lens Scripting Version 364

    null
    
    var options = new TextInputSystem.KeyboardOptions();

    options.onBeginBatchEdit = function() {
    print("Begin batch edit");
    };

    global.textInputSystem.requestKeyboard(options);
    onCommitText: (text: string, newCursorPosition: number) => void

    Callback to be invoked when text should be committed to the selection/composing region.

    Lens Scripting Version 364

    null
    
    var options = new TextInputSystem.KeyboardOptions();

    options.onCommitText = function(text, newCursorPosition) {
    print("Commit text:", text, newCursorPosition);
    };

    global.textInputSystem.requestKeyboard(options);
    onEndBatchEdit: () => void

    Callback to be invoked when a batch edit session is ended. Editors can resume their updates after receiving this callback

    Lens Scripting Version 364

    null
    
    var options = new TextInputSystem.KeyboardOptions();

    options.onEndBatchEdit = function() {
    print("End batch edit");
    };

    global.textInputSystem.requestKeyboard(options);
    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.

    onPerformEditorAction: (action: TextFieldAction) => void

    Callback to be invoked when an editor action should be performed. This is typically used to perform actions like "search", "go", "next", "send", "newline", "done".

    Lens Scripting Version 364

    null
    
    var options = new TextInputSystem.KeyboardOptions();

    options.onPerformEditorAction = function(action) {
    print("Perform editor action:", action);
    };

    global.textInputSystem.requestKeyboard(options);
    onReturnKeyPressed: () => void

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

    onSetComposingRegion: (start: number, end: number) => void

    Callback to be invoked when the composing region is changed.

    Lens Scripting Version 364

    null
    
    var options = new TextInputSystem.KeyboardOptions();

    options.onSetComposingRegion = function(start, end) {
    print("Composing region:", start, end);
    };

    global.textInputSystem.requestKeyboard(options);
    onSetComposingText: (text: string, newCursorPosition: number) => void

    Callback to be invoked when the composing text is changed.

    Lens Scripting Version 364

    null
    
    var options = new TextInputSystem.KeyboardOptions();

    options.onSetComposingText = function(text, newCursorPosition) {
    print("Composing text:", text, newCursorPosition);
    };

    global.textInputSystem.requestKeyboard(options);
    onSetSelection: (start: number, end: number) => void

    Callback to be invoked when there selection range is changed.

    Lens Scripting Version 364

    null
    
    var options = new TextInputSystem.KeyboardOptions();

    options.onSetSelection = function(start, end) {
    print("Selection:", start, end);
    };

    global.textInputSystem.requestKeyboard(options);
    onTextChanged: (text: string, range: vec2) => void

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

    onUpdateText: (updatedText: TextUpdate) => void

    Callback to be invoked when there is a text update from the input method in the current cursor position.

    Lens Scripting Version 364

    null
    
    var options = new TextInputSystem.KeyboardOptions();

    options.onUpdateText = function(updatedText) {
    print("Updated text:", updatedText.text);
    };

    global.textInputSystem.requestKeyboard(options);
    returnKeyType: ReturnKeyType

    Requested return key type.

    Lens Scripting Version 165

    TextInputSystem.ReturnKeyType.Done