Back to Content

Gamepad: mapping property

files/en-us/web/api/gamepad/mapping/index.md

latest761 B
Original Source

{{APIRef("Gamepad API")}}

The Gamepad.mapping property of the {{domxref("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

{{Specifications}}

Browser compatibility

{{Compat}}

See also

Using the Gamepad API