SNAPCHAT AR: LENS STUDIO KEYBOARD

December 2018

As there is no built-in keyboard feature in Lens Studio yet, I decided to make one myself. One day there will be a real, proper keyboard in there, but I think this is a nice solution for now.

For easy installation instructions and a quick explanation of how to use it, check the readme-file!

No programming is required to use the Keyboard, but it is possible to call certain functions (the full list is in the readme-file).

 

 

 

lens studio keyboard

This script does not work for Lens Studio 2.0 or newer! When I find some time, I will look into that.
In the meantime, let’s just hope Lens Studio gets its own keyboard 🙂

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

 

Lens Studio Keyboard prefab multiline

There are two more panels for symbols and numbers:

 

Lens Studio Keyboard prefab

Lens Studio Keyboard prefab

  And you’ve got some customization options:

lens studio keyboard preferences

More advanced usage

To quickly change the colours/materials of the keys, simply edit the Materials in the Resources folder.

To set a default text, type it into the ‘Default Text’ textbox in the Keyboard settings.
To make a multi-line default text, add ‘\n’ (without quotation marks) where you want a line split.
For example: “First line.\nSecond line.” would become:
“First line.”
“Second Line.”

To change the look of all keys simultaneously, delete all but one key in the ‘Keyboard/Keyboard/KeyboardObject/Keys’ object in the scene.
Simply change the look of the one remaining key to your liking, and duplicate it 30 times again.
The Keyboard script will automatically place the duplicated keys correctly and add their labels and all that.

 

 

 

Javascript use (can be called from any script at any time):

 

 

global.KeyboardResult()

Function – Get the keyboard output. Use an int value as optional argument to ask for a specific line! (E.g. ‘global.KeyboardResult(3)’ for line 3.)

global.KeyboardSwitch();

Function – Show/hide the keyboard toggle.

global.KeyboardPlayKeySound();

Function – Plays the sound (if added in the UI) on key press.

global.KeyboardVisible;

Bool – Check if keyboard is currently visible.

global.KeyboardHideWhenRecording;

Bool – Check if the Keyboard will be hidden when recording.

global.KeyboardMaxLines;

Int – Get the amount of lines allowed to scroll through.

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!