--- title: gamepadconnected slug: Web/API/Window/gamepadconnected_event translation_of: Web/API/Window/gamepadconnected_event ---
gamepadconnected
イベントは、ゲームパッドが接続されたことをブラウザが検出したとき、またはゲームパッドのボタン/軸が初めて使用されたときに発生します。
<window>
)Property | Type | Description |
---|---|---|
target {{readonlyInline}} |
{{domxref("EventTarget")}} | The event target (the topmost target in the DOM tree). |
type {{readonlyInline}} |
{{domxref("DOMString")}} | The type of event. |
bubbles {{readonlyInline}} |
{{jsxref("Boolean")}} | Whether the event normally bubbles or not. |
cancelable {{readonlyInline}} |
{{jsxref("Boolean")}} | Whether the event is cancellable or not. |
gamepad {{readonlyInline}} |
{{domxref("Gamepad")}} | The single gamepad attribute provides access to the associated gamepad data for this event. |
// Note that the API is still vendor-prefixed in browsers implementing it window.addEventListener("gamepadconnected", function( event ) { // All buttons and axes values can be accessed through event.gamepad; });