DualShockPad

Defines a DualShock gamepad

Hierarchy

Index

Constructors

constructor

Find examples in Playground
  • new DualShockPad(id: string, index: number, gamepad: any): DualShockPad
  • Creates a new DualShock gamepad object

    Parameters

    • id: string

      defines the id of this gamepad

    • index: number

      defines its index

    • gamepad: any

      defines the internal HTML gamepad object

    Returns DualShockPad

Properties

browserGamepad

Find examples in Playground
browserGamepad: any

The browser gamepad

buttonCircle

Find examples in Playground
buttonCircle: number

Sets the value of the Circle button

buttonCross

Find examples in Playground
buttonCross: number

Sets the value of the Cross button

buttonL1

Find examples in Playground
buttonL1: number

Sets the value of the L1 button

buttonLeftStick

Find examples in Playground
buttonLeftStick: number

Sets the value of the Left joystick

buttonOptions

Find examples in Playground
buttonOptions: number

Sets the value of the Options button

buttonR1

Find examples in Playground
buttonR1: number

Sets the value of the R1 button

buttonRightStick

Find examples in Playground
buttonRightStick: number

Sets the value of the Right joystick

buttonShare

Find examples in Playground
buttonShare: number

Sets the value of the Share button

buttonSquare

Find examples in Playground
buttonSquare: number

Sets the value of the Square button

buttonTriangle

Find examples in Playground
buttonTriangle: number

Sets the value of the Triangle button

dPadDown

Find examples in Playground
dPadDown: number

Sets the value of D-pad down

dPadLeft

Find examples in Playground
dPadLeft: number

Sets the value of D-pad left

dPadRight

Find examples in Playground
dPadRight: number

Sets the value of D-pad right

dPadUp

Find examples in Playground
dPadUp: number

Sets the value of D-pad up

id

Find examples in Playground
id: string

The id of the gamepad

index

Find examples in Playground
index: number

The index of the gamepad

isConnected

Find examples in Playground
isConnected: boolean

Specifies if the gamepad has been connected

leftStick

Find examples in Playground
leftStick: StickValues

Sets the left joystick values

leftTrigger

Find examples in Playground
leftTrigger: number

Sets the left trigger value

onButtonDownObservable

Find examples in Playground
onButtonDownObservable: Observable<DualShockButton>

Observable raised when a button is pressed

onButtonUpObservable

Find examples in Playground
onButtonUpObservable: Observable<DualShockButton>

Observable raised when a button is released

onPadDownObservable

Find examples in Playground
onPadDownObservable: Observable<DualShockDpad>

Observable raised when a pad is pressed

onPadUpObservable

Find examples in Playground
onPadUpObservable: Observable<DualShockDpad>

Observable raised when a pad is released

rightStick

Find examples in Playground
rightStick: StickValues

Sets the right joystick value

rightTrigger

Find examples in Playground
rightTrigger: number

Sets the right trigger value

type

Find examples in Playground
type: number

Specifies what type of gamepad this represents

Static DUALSHOCK

Find examples in Playground
DUALSHOCK: number

Represents an Dual Shock controller

Static GAMEPAD

Find examples in Playground
GAMEPAD: number

Represents a gamepad controller

Static GENERIC

Find examples in Playground
GENERIC: number

Represents a generic controller

Static POSE_ENABLED

Find examples in Playground
POSE_ENABLED: number

Represents a pose-enabled controller

Static XBOX

Find examples in Playground
XBOX: number

Represents an XBox controller

Methods

dispose

Find examples in Playground
  • dispose(): void

onbuttondown

Find examples in Playground
  • onbuttondown(callback: function): void
  • Defines the callback to call when a button is pressed

    Parameters

    Returns void

onbuttonup

Find examples in Playground
  • onbuttonup(callback: function): void
  • Defines the callback to call when a button is released

    Parameters

    Returns void

ondpaddown

Find examples in Playground
  • ondpaddown(callback: function): void
  • Defines the callback to call when a pad is pressed

    Parameters

    • callback: function

      defines the callback to use

    Returns void

ondpadup

Find examples in Playground
  • ondpadup(callback: function): void
  • Defines the callback to call when a pad is released

    Parameters

    • callback: function

      defines the callback to use

    Returns void

onleftstickchanged

Find examples in Playground
  • onleftstickchanged(callback: function): void

onlefttriggerchanged

Find examples in Playground
  • onlefttriggerchanged(callback: function): void
  • Defines the callback to call when left trigger is pressed

    Parameters

    • callback: function

      defines the callback to use

        • (value: number): void
        • Parameters

          • value: number

          Returns void

    Returns void

onrightstickchanged

Find examples in Playground
  • onrightstickchanged(callback: function): void

onrighttriggerchanged

Find examples in Playground
  • onrighttriggerchanged(callback: function): void
  • Defines the callback to call when right trigger is pressed

    Parameters

    • callback: function

      defines the callback to use

        • (value: number): void
        • Parameters

          • value: number

          Returns void

    Returns void

update

Find examples in Playground
  • update(): void
  • Force the gamepad to synchronize with device values

    Returns void

Generated using TypeDoc