Movatterモバイル変換


[0]ホーム

URL:


Skip to content
Experimental WebAPI
GitHub

GamepadAPI

Types

gamepad

This Gamepad API interface defines an individual gamepad or other controller, allowing access to information such as button presses, axis positions, and id.See Gamepad on MDN

typegamepad= {
id:string,
index:int,
connected:bool,
timestamp:float,
mapping:gamepadMappingType,
axes:array<float>,
buttons:array<gamepadButton>,
vibrationActuator:gamepadHapticActuator,
}

Record fields

connected
bool
timestamp
float
axes
array< float >

gamepadButton

An individual button of a gamepad or other controller, allowing access to the current state of different types of buttons available on the control device.See GamepadButton on MDN

typegamepadButton= {
pressed:bool,
touched:bool,
value:float,
}

Record fields

pressed
bool
touched
bool
value
float

gamepadEffectParameters

typegamepadEffectParameters= {
mutableduration?:int,
mutablestartDelay?:int,
mutablestrongMagnitude?:float,
mutableweakMagnitude?:float,
mutableleftTrigger?:float,
mutablerightTrigger?:float,
}

Record fields

duration
option< int >
startDelay
option< int >
strongMagnitude
option< float >
weakMagnitude
option< float >
leftTrigger
option< float >
rightTrigger
option< float >

gamepadHapticActuator

This Gamepad API interface represents hardware in the controller designed to provide haptic feedback to the user (if available), most commonly vibration hardware.See GamepadHapticActuator on MDN

typegamepadHapticActuator= {}

Module

There are methods and helpers defined in GamepadHapticActuator.

gamepadHapticEffectType

typegamepadHapticEffectType=
| @as("dual-rumble")DualRumble
| @as("trigger-rumble")TriggerRumble

gamepadHapticsResult

typegamepadHapticsResult=
| @as("complete")Complete
| @as("preempted")Preempted

gamepadMappingType

typegamepadMappingType=
| @as("standard")Standard
| @as("xr-standard")XrStandard

[8]ページ先頭

©2009-2025 Movatter.jp