dot big bang

Developer API
Menu

Class GamepadButton

All
  • Public
  • Public/Protected
  • All

Hierarchy

  • GamepadButton

Index

Constructors

Properties

Constructors

constructor

Properties

Readonly pressed

pressed: boolean

Indicates whether the button is pressed. For buttons which do not have a digital switch to indicate a pure pressed or released state, the browser internally uses a threshold to indicate the button as pressed.

Readonly touched

touched: boolean

Indicates whether the button is touched, if the button is capable of detecting touch. If it's not, and if it is capable of reporting an analog value, this property is true when the value is greater than 0, and false if the value is 0. If it's capable of detecting touch, nor reporting digital value, this property mirrors the pressed property.

Readonly value

value: number

For buttons that have an analog sensor, this property represents the amount which the button has been pressed. All button values are linearly normalized to the range [0.0 .. 1.0]. 0.0 means fully unpressed, and 1.0 means fully pressed. For buttons without an analog sensor, only the values 0.0 and 1.0 for fully unpressed and fully pressed respectively are provided.