Skip to main content

Keyboard

Overview

The Keyboard enables users to input any alphanumeric character, including special characters. It supports use cases such as web browsing, entering usernames/passwords, and sending messages.

Developer Control

Developers have the ability to enable or disable the keyboard during a Lens session. The keyboard layout can be adjusted through the Keyboard Type Configuration, which includes options for Text, URL, Numpad, and Phone.

Prerequisites

Lens Studio v5.7.0 or later

Spectacles OS v5.060 or later

Mobile Spectacles App Keyboard

The mobile Spectacles App supports keyboard functionality via the user's mobile device.

When the mobile keyboard is active, users can close it to revert to the AR Keyboard. A system notification will indicate "keyboard disconnected."

AR Keyboard

The AR Keyboard is a digital overlay displayed within the Lens experience on the Spectacles device. When activated, it animates directly in front of the user.

Users can switch to the mobile Spectacles app keyboard from the AR Keyboard. A system notification will confirm "keyboard connected."

Activation Scenarios

Opening the Keyboard

  • If the Spectacles app is not connected, the AR Keyboard will animate directly in front of the user.

  • If the Spectacles app is connected but not open, the AR Keyboard will animate directly in front of the user, and a mobile notification will alert that the mobile keyboard is available.

  • If the Spectacles app is both connected and open, the mobile keyboard will be activated, accompanied by a system notification stating "keyboard connected."

Closing the Keyboard

Pressing the return key on either keyboard will deactivate the text input field and close the keyboard.

Example Usage

require('LensStudio:TextInputModule');

export class KeyboardExample extends BaseScriptComponent {
onAwake() {
this.createEvent('OnStartEvent').bind(() => {
let options = new TextInputSystem.KeyboardOptions();
options.enablePreview = true;
options.keyboardType = TextInputSystem.KeyboardType.Text;
options.returnKeyType = TextInputSystem.ReturnKeyType.Return;

global.textInputSystem.requestKeyboard(options);
});
}
}
Was this page helpful?
Yes
No