Gamepad API
Baseline
Widely available
*
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since 2017ë 3ì.
* Some parts of this feature may have varying levels of support.
ê²ìí¨ë APIë ê²ìí¨ëì ë¤ë¥¸ ê²ì ì ì´ì¥ì¹ì ì í¸ì ì¬ì´ ì¼ê´ë ë°©ìì¼ë¡ ì ê·¼íê³ ìëµíë ê°ë°ìë¤ì ìí ìë¨ì´ë¤. ê²ìí¨ë APIë ì¸ ê°ì§ ì¸í°íì´ì¤ìì°ê²°, ì°ê²° í´ì ëê³ ê²ì í¨ë ìì²´ì ëí ë¤ë¥¸ ì ë³´ì ì ê·¼íê³ ì´ë¤ ë²í¼ê³¼ ë¤ë¥¸ ì¡°ì ì¥ì¹ë¤ì´ íì¬ ë린 ê²ì ìëµíë ë ê°ì§ ì´ë²¤í¸ ê·¸ë¦¬ê³ í ê°ì§ í¹ì 기ë¥ì´ í¬í¨ëì´ ìë¤.
ì¸í°íì´ì¤
Gamepad-
ì»´í¨í°ì ì°ê²°ë ê²ìí¨ëë ì¡°ìì¥ì¹ë¥¼ íííë¤.
-
ì°ê²°ë ì¡°ìì¥ì¹ë¤ ì¤ íëì ìë ë²í¼ì íííë¤.
GamepadEvent-
ê²ì í¨ëì ì°ê´ë ì´ë²¤í¸ë¥¼ ëíë´ë ì´ë²¤í¸ ê°ì²´ì´ë¤.
ê²ìí¨ë íì¥ê¸°ë¥ ì¤í
GamepadHapticActuator-
Represents hardware in the controller designed to provide haptic feedback to the user (if available), most commonly vibration hardware.
GamepadPose-
Represents the pose of a controller (e.g. position and orientation in 3D space) in the case of a WebVR controller.
ë¤ì ì 보를ìì¸ì¤í ì ìë ê²ìí¨ë ì¸í°íì´ì¤ íì¥ê¸°ë¥ ë보기
ë¤ë¥¸ ì¸í°íì´ì¤ë¡ íì¥
Navigator
-
An extension to the
Navigatorobject that returns an array ofGamepadobjects, one for each connected gamepad.
Window events
Window.ongamepadconnected-
Represents an event handler that will run when a gamepad is connected (when the
gamepadconnectedevent fires). Window.ongamepaddisconnected-
Represents an event handler that will run when a gamepad is disconnected (when the
gamepaddisconnectedevent fires).
íí 리ì¼ê³¼ ê°ì´ë
ëª ì¸ì
| Specification |
|---|
| Gamepad > # gamepad-interface > |
| Gamepad Extensions > # partial-gamepad-interface > |
ë¸ë¼ì°ì í¸íì±
ë보기
- The Gamepad API by Ted Mielczarek and Robert Nyman
- Simple API demo page (source)