Gamepad: mapping プロパティ
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2017.
Gamepad.mapping
は Gamepad
インターフェイスのプロパティで、ブラウザーが機器のコントロールを既知のレイアウトに再マップしたかどうかを示す文字列を返します。
現在、サポートされている既知のレイアウトは次の通りです。
- "standard": 標準のゲームパッド
- "xr-standard": 標準 XR ゲームパッド。
XRInputSource.gamepad
も参照してください。
例
js
let gp = navigator.getGamepads()[0];
console.log(gp.mapping);
仕様書
Specification |
---|
Gamepad # dom-gamepad-mapping |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
mapping |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.