Skip to main content

GameControllerModule.Button

Enum

Common gamepad button identifiers.

  • Snapchat: not supported
  • SPECS: fully supported
  • Camera Kit Web: not supported
  • Camera Kit Mobile: not supported
1 platform note
  • SnapchatNot supported — Available on SPECS only
  • SPECSFully supported
    • Experimental API; it may change or be removed.
  • Camera Kit WebNot supported — Available on SPECS only
  • Camera Kit MobileNot supported — Available on SPECS only

Platform details

  • Snapchat — Not supported — Available on SPECS only.

  • SPECS — Fully supported. Experimental API; it may change or be removed

  • Camera Kit Web — Not supported — Available on SPECS only.

  • Camera Kit Mobile — Not supported — Available on SPECS only.

Since Lens Scripting v373Experimental

Common gamepad button identifiers. Face buttons use positional names (compass directions when looking at the right-hand button diamond) so they are layout-neutral across controller families. Use ControllerInfo.type to map these to platform-appropriate labels.

Index

Example

//@input Asset.GameControllerModule gameControllerModule
var provider = script.gameControllerModule.createController();
provider.onButtonEvent.add(function(event) {
if (event.button === GameControllerModule.Button.South) {
print("South button (Xbox A / PlayStation Cross)");
}
});

Enumeration Members

DpadDown

DpadDown: number

ExperimentalSPECS

D-pad down.

Since

Lens Scripting Version 373


DpadLeft

DpadLeft: number

ExperimentalSPECS

D-pad left.

Since

Lens Scripting Version 373


DpadRight

DpadRight: number

ExperimentalSPECS

D-pad right.

Since

Lens Scripting Version 373


DpadUp

DpadUp: number

ExperimentalSPECS

D-pad up.

Since

Lens Scripting Version 373


East

East: number

ExperimentalSPECS

Right face button (Xbox: B, PlayStation: Circle, Switch: A).

Since

Lens Scripting Version 373


LeftBumper

LeftBumper: number

ExperimentalSPECS

Left shoulder button.

Since

Lens Scripting Version 373


LeftThumbstick

LeftThumbstick: number

ExperimentalSPECS

Left thumbstick click (L3).

Since

Lens Scripting Version 373


LeftTrigger

LeftTrigger: number

ExperimentalSPECS

Left trigger (digital press; for analog value use onAnalogTriggerEvent).

Since

Lens Scripting Version 373


North

North: number

ExperimentalSPECS

Top face button (Xbox: Y, PlayStation: Triangle, Switch: X).

Since

Lens Scripting Version 373


RightBumper

RightBumper: number

ExperimentalSPECS

Right shoulder button.

Since

Lens Scripting Version 373


RightThumbstick

RightThumbstick: number

ExperimentalSPECS

Right thumbstick click (R3).

Since

Lens Scripting Version 373


RightTrigger

RightTrigger: number

ExperimentalSPECS

Right trigger (digital press; for analog value use onAnalogTriggerEvent).

Since

Lens Scripting Version 373


Select

Select: number

ExperimentalSPECS

Select / Share / Minus button.

Since

Lens Scripting Version 373


South

South: number

ExperimentalSPECS

Bottom face button (Xbox: A, PlayStation: Cross, Switch: B).

Since

Lens Scripting Version 373


Start

Start: number

ExperimentalSPECS

Start / Options / Plus button.

Since

Lens Scripting Version 373


West

West: number

ExperimentalSPECS

Left face button (Xbox: X, PlayStation: Square, Switch: Y).

Since

Lens Scripting Version 373