Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. Gamepad
  4. connected

Gamepad: connected property

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

Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.

TheGamepad.connected property of theGamepad interface returns a boolean indicating whether the gamepad isstill connected to the system.

If the gamepad is connected, the value istrue; if not, it isfalse.

Value

A boolean.

Examples

js
const gp = navigator.getGamepads()[0];console.log(gp.connected);

Specifications

Specification
Gamepad
# dom-gamepad-connected

Browser compatibility

See also

Using the Gamepad API

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp