Skip to main content

Interaction

Touch, tap, gestures and manipulation, SPECS hand gestures (Gesture Module), keyboard and text input, controllers, and haptics.

Commonly used

Guides

All APIs in this topic

Add components to a scene object, reference assets and other modules with a script input, require modules with require('LensStudio:<name>'), and create events with script.createEvent('<name>').

Components, assets, and modules

APIDescription
GameControllerModule SPECSProvides access to game controller input on Spectacles.
GestureModule SPECSAllows to detect hand gestures using machine learning algorithms.
InteractionComponentEnables invoking touch interactions with a BaseMeshVisual rendered to specific Camera.
ManipulateComponentHandles input information from user touch input via the InteractionComponent to control the Scale, Rotation, and Translation of objects.
MotionControllerModule SPECS
SpecsInteractionModule SPECSEntry point for the SPECS Interaction System.
TextInputModuleDeclares the Input Framework (Text) permission for your Lens project.

Events

APIDescription
DoubleTapEventTriggered when a double tap event has occurred.
HoverEndEventTriggered when hovering state has ended on an InteractionComponent.
HoverEventTriggered when a mouse hover event occurs.
HoverStartEventBase class for all object-based Event types in Lens Studio (ManipulateStartEvent, TapEvent, etc.).
KeyPressEventThis event is triggered when the user presses a key.
KeyReleaseEventThis event is triggered when the user releases a key.
ManipulateEndEventThis event is triggered when manipulation on the object ends.
ManipulateStartEventThis event is triggered when manipulation on the object begins.
PanGestureEndEventTriggered when a pan gesture ends.
PanGestureMoveEventTriggered while the user is panning.
PanGestureStartEventTriggered when a pan gesture starts.
PinchGestureEndEventTriggered when a pinch gesture ends.
PinchGestureMoveEventTriggered while the user is pinching.
PinchGestureStartEventTriggered when a pinch gesture starts.
TapEventThis event is triggered when the user taps on the screen.
TouchEndEventTriggered when a touch event ends.
TouchMoveEventTriggered when a touch position on the screen is moved.
TouchStartEventTriggered when a touch event starts.
TriggerPrimaryEventGets called when the user triggers the primary input on their device.

Event data

APIDescription
DoubleTapEventArgsBase class for objects representing Script data.
FocusEndEventArgsArguments used with the InteractionComponent.onFocusEnd event.
FocusStartEventArgsArguments used with the InteractionComponent.onFocusStart event.
GesturesDataArgs SPECS
GrabBeginArgs SPECSThe arguments of the GrabBegin event on GestureModule.
GrabEndArgs SPECSThe arguments of the GrabEnd event on GestureModule.
HoverEndEventArgsThe arguments passed in by HoverEndEvent.
HoverEventArgsBase class for objects representing Script data.
HoverStartEventArgsThe arguments passed in by HoverStartEvent.
IsPhoneInHandBeginArgs SPECSThe arguments of getIsPhoneInHandBeginEvent on GestureModule.
IsPhoneInHandEndArgs SPECSThe arguments of getIsPhoneInHandEndEvent on GestureModule.
LongPressEndEventArgsArguments used with the InteractionComponent#onLongPressEnd event.
LongPressStartEventArgsArguments used with the InteractionComponent#onLonPressStart event.
ManipulateEndEventArgsArguments used with the ManipulateComponent.onManipulateEnd event.
ManipulateStartEventArgsArguments used with the ManipulateComponent.onManipulateStart event.
PalmTapDownArgs SPECSThe arguments of the PalmTapDown event on GestureModule
PalmTapUpArgs SPECSThe arguments of the PalmTapUp event on GestureModule
PanEndEventArgsArguments used with the InteractionComponent#onPanEnd event.
PanMoveEventArgsArguments used with the InteractionComponent#onPanMove event.
PanStartEventArgsArguments used with the InteractionComponent#onPanStart event.
PinchDownArgs SPECSThe arguments of the PinchDown event on GestureModule
PinchEndEventArgsArguments used with the InteractionComponent#onPinchEnd event.
PinchMoveEventArgsArguments used with the InteractionComponent#onPinchMove event.
PinchStartEventArgsArguments used with the InteractionComponent#onPinchStart event.
PinchStrengthArgs SPECSThe arguments of the PinchStrength event on GestureModule
PinchUpArgs SPECSThe arguments of the PinchUp event on GestureModule
ScrollEndEventArgsArguments used with the InteractionComponent#onScrollEnd event.
ScrollEventArgsArguments used with the InteractionComponent#onScroll event.
ScrollStartEventArgsArguments used with the InteractionComponent#onScrollStart event.
SelectEndEventArgsArguments used with the InteractionComponent.onSelectEnd event.
SelectStartEventArgsArguments used with the InteractionComponent.onSelectStart event.
TapEventArgsArguments used with the InteractionComponent.onTap event.
TargetingDataArgs SPECS
TouchEndEventArgsArguments used with the InteractionComponent.onTouchEnd event.
TouchMoveEventArgsArguments used with the InteractionComponent.onTouchMove event.
TouchStartEventArgsArguments used with the InteractionComponent.onTouchStart event.
TriggerPrimaryEventArgsArguments used with the InteractionComponent.onTriggerPrimary event.

Objects and data

APIDescription
GameControllerSession SPECSRepresents an active game controller session.
HapticFeedbackSystemTriggers haptic feedback on the device.
KeyboardManager
ManipulateFrameIntersectResultResult object returned from ManipulateComponent.intersectManipulateFrame.
MotionController SPECSGives access to motion data and touch events from an external device to Spectacles, as well as haptic feedback requests from Spectacles to an external device.
TextInputSystemProvides access to the device's input system.
TouchDataProviderThis provider is returned by global.touchSystem and allows your lens to handle any touches on the screen, and optionally let certain touch types to pass thro…

Enums

APIDescription
HapticFeedbackTypeThe method in which haptic feedback is provided.
KeyModifiers
Keys
ManipulateTypeEnum values specifying each type of manipulation.
TouchState