SNAPCHAT AR: LENS STUDIO KEYBOARD

December 2018, updated July 2021

Since there is no built-in keyboard feature in Lens Studio yet, I made this as a temporary workaround.

No programming is required to use the Keyboard, but it is possible to call certain functions
to interact with the keyboard through your own scripts (the list of features is at the end of this page).

 

 

 

 

 

lens studio keyboard

The keyboard supports single-line and multi-line text, with as many lines as you’d like.

 

lens studio keyboard

 

There is a SHIFT button for capitals, and there are two more panels for symbols and numbers:

 

lens studio keyboardlens studio keyboard

 

  And it has some customization options:

 

keyboard settings lens studio

Usage

To get the text typed by the user on a Text component, add the ‘Get Keyboard Text’-script to an object.

lens studio keyboard

 

To quickly change the look of the keys, edit the ‘Keyboard Keys’ material.
This material takes care of the toggle, space bar, and normal keys, in both states: pressed and idle.

 

To set a default text (and optional multi-line count), type it in the ‘Default Text Lines’ textbox in the Keyboard settings.

 

 

 

Javascript use (can be called at any time from any script in the project)

– Get the first line of text as a string (function, optional int argument to specify which line if multiline)
global.keyboard.getLine()

Examples:
global.keyboard.getLine() – reads first line of text (default)
global.keyboard.getLine(1) – reads second line of text

– Check if keyboard is currently visible (bool)
global.keyboard.isActive

– Toggle keyboard in/out animation (function)
global.keyboard.toggle()

– Get or set keyboard out text lines (array)
global.keyboard.lines

– Get the current line the user is typing in (Number)
global.keyboard.currentLine

– Check if the user is currently in the Symbols tab (bool)
global.keyboard.symbols

– Check if the user is currently using Caps Lock (bool)
global.keyboard.capslock

Keyboard in action

You asked for it – Custom text notifications! from r/SnapLenses

 
 
 
 
 
View this post on Instagram
 
 
 
 
 
 
 
 
 

Made a customizable keyboard for a #snaplens in #lensstudio – I’ll share the project files some time soon A post shared by max (@maxeflats) on

If you have any questions/suggestions, let me know!