W3cubDocs

/Web APIs

Gamepad: mapping property

The Gamepad.mapping property of the Gamepad interface returns a string indicating whether the browser has remapped the controls on the device to a known layout.

The currently supported known layouts are:

Examples

js

let gp = navigator.getGamepads()[0];
console.log(gp.mapping);

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
mapping 21 12 29 No 15 10.1 4.4 25 32 14 10.3 1.5

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/mapping