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 365

    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 365

    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 365

    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.

    null
    
    onKeyboardKindChanged: (keyboardKind: KeyboardKind) => void

    Callback to be invoked when the kind of keyboard serving your text input session changes. The current kind is delivered right after the keyboard request. If the current text input follows pose suggestions, the last suggestion must be discarded when this callback is fired until new suggestion arrives.

    Lens Scripting Version 372

    null
    
    onKeyboardStateChanged: (keyboardIsOpen: boolean) => void

    Callback to be invoked when keyboard is shown or dismissed.

    null
    
    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 365

    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.

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

    Callback to be invoked when the composing region is changed.

    Lens Scripting Version 365

    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 365

    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 365

    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.

    null
    
    onTextInputPoseSuggestionChanged: (
        position: vec3,
        rotation: quat,
        size: vec2,
    ) => void

    Callback to be invoked with where the system suggests you place the edited content: position/rotation is the suggested bottom center of the text input UI element that currently has focus (just above the keyboard's top edge) in your Lens's world space (in centimeters). size (in centimeters), when non-zero, is the recommended (but not enforced) content size. Disregard the last suggestion after onKeyboardKindChanged.

    Lens Scripting Version 372

    null
    
    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 365

    null
    
    var options = new TextInputSystem.KeyboardOptions();

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

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

    Callback to be invoked when the user releases the virtual keyboard after a drag. Always paired with a preceding onVirtualKeyboardMoveStarted.

    Lens Scripting Version 372

    null
    
    onVirtualKeyboardMoveStarted: () => void

    Callback to be invoked when the user grabs the virtual keyboard and starts dragging it. Apply transient drag effects, if any, to your content; pose suggestions may keep streaming during the move. Late joiners are notified if a keyboard move is in progress.

    Lens Scripting Version 372

    null
    
    returnKeyType: ReturnKeyType

    Requested return key type.

    Lens Scripting Version 165

    TextInputSystem.ReturnKeyType.Done
    

    Methods

    • Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().

      Returns string