[go: up one dir, main page]

このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。

View in English Always switch to English

GamepadEvent: GamepadEvent() コンストラクター

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月⁩.

GamepadEvent() コンストラクターは、新しい GamepadEvent オブジェクトを作成します。

構文

js
new GamepadEvent(type, options)

引数

type

このイベントの名前の文字列です。 大文字小文字を区別し、ブラウザーは gamepadconnected または gamepaddisconnected に設定します。

options

オブジェクトで、Event() で定義されたプロパティに加え、以下のプロパティを持つことができます。

gamepad

このイベントに関連付けられたゲームパッドを記述する Gamepad オブジェクトです。

返値

新しい GamepadEvent オブジェクトです。

仕様書

Specification
Gamepad
# dom-gamepadevent-constructor

ブラウザーの互換性