blob: d614c6ebf4b34143e1e43bffba722471d6bfce91 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
---
title: Gamepad.connected
slug: Web/API/Gamepad/connected
tags:
- API
- Gamepad API
- Games
- NeedsBetterSpecLink
- NeedsMarkupWork
- Property
- Reference
- Référence(2)
translation_of: Web/API/Gamepad/connected
---
<p>{{APIRef("Gamepad API")}}</p>
<p>{{domxref("Gamepad") }} インターフェースの <code><strong>Gamepad.connected</strong></code> プロパティはゲームパッドがシステムに接続しているかどうかを示す真偽値を返します。</p>
<p>ゲームパッドが接続している場合の値は <code>true</code> 、繋がっていない場合は <code>false</code>となります。</p>
<h2 id="構文">構文</h2>
<pre class="syntaxbox notranslate"><span class="idlInterface" id="idl-def-Gamepad"><span class="idlAttribute"> readonly attribute <span class="idlAttrType">boolean</span> <span class="idlAttrName">connected</span>;</span></span></pre>
<h2 id="例">例</h2>
<pre class="brush: js notranslate">var gp = navigator.getGamepads()[0];
console.log(gp.connected);</pre>
<h2 id="値">値</h2>
<p>{{domxref("boolean")}} 。</p>
<h2 id="仕様">仕様</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">仕様</th>
<th scope="col">ステータス</th>
<th scope="col">備考</th>
</tr>
<tr>
<td>{{SpecName("Gamepad", "#widl-Gamepad-connected", "Gamepad.connected")}}</td>
<td>{{Spec2("Gamepad")}}</td>
<td>初回定義</td>
</tr>
</tbody>
</table>
<h2 id="ブラウザの互換性">ブラウザの互換性</h2>
<p>{{Compat("api.Gamepad.connected")}}</p>
<h2 id="参照">参照</h2>
<p><a href="/ja/docs/Web/Guide/API/Gamepad">Gamepad API を利用する</a></p>
|