Gamepad: mapping property

فهرست فصل‌ها دانلود آرشیوناشر

MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونه‌کد

{{APIRef("Gamepad API")}}

The **mapping** read-only 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:

  • "standard" for the standard gamepad.
  • "xr-standard" for the standard XR gamepad. See also {{domxref("XRInputSource.gamepad")}}.

Examples

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

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

Using the Gamepad API