aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/api/gamepad_api/index.md
blob: 7e81e21b272db9dc0ffca202b99f70fb109e6ecb (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
---
title: Gamepad API
slug: Web/API/Gamepad_API
translation_of: Web/API/Gamepad_API
---
<div>{{DefaultAPISidebar("Gamepad API")}}</div>

<p>L'<strong>API Gamepad</strong> est un moyen pour les développeurs d'accéder aux signaux provenant des manettes des jeu et des autres unités de commande du jeu d'y répondre de manière simple et systématiq. Il contient trois interfaces, deux événements et une fonction spécialisée, pour répondre aux manettes connectées et déconnectées, et pour accéder à d'autres informations sur les manettes elles-mêmes, ainsi que sur les boutons et autres commandes sur lesquels vous appuyez actuellement.</p>

<h2 id="Interfaces">Interfaces</h2>

<dl>
 <dt><a href="/en-US/docs/Web/API/Gamepad"><code>Gamepad</code></a></dt>
 <dd>Représente une manette de jeu / unités de commande du jeu connecté à l'ordinateur.</dd>
 <dt><a href="/en-US/docs/Web/API/GamepadButton"><code>GamepadButton</code></a></dt>
 <dd>Représente un bouton sur un gamepad connecté.</dd>
 <dt><a href="/en-US/docs/Web/API/GamepadEvent"><code>GamepadEvent</code></a></dt>
 <dd>L'objet d'événement qui déclenche des événements sur la manette de jeu contiguë de manière représentative.</dd>
</dl>

<h3 id="Extensions_de_manette_du_jeu_expérimentales">Extensions de manette du jeu expérimentales</h3>

<dl>
 <dt><a href="/en-US/docs/Web/API/GamepadHapticActuator"><code>GamepadHapticActuator</code></a></dt>
 <dd>Represents hardware in the controller designed to provide haptic feedback to the user (if available), most commonly vibration hardware.</dd>
 <dt><a href="/en-US/docs/Web/API/GamepadPose"><code>GamepadPose</code></a></dt>
 <dd>Represents the pose of a controller (e.g. position and orientation in 3D space) in the case of a <a href="/en-US/docs/Web/API/WebVR_API">WebVR</a>controller.</dd>
</dl>

<p>See also the <a href="/en-US/docs/Web/API/Gamepad#Experimental_extensions_to_Gamepad">extensions to the Gamepad interface</a>, for features that allow you to access the above information.</p>

<h3 id="Extensions_à_d'autres_interfaces">Extensions à d'autres interfaces</h3>

<h4 id="Navigator">Navigator</h4>

<dl>
 <dt>{{domxref("Navigator.getGamepads()")}}</dt>
 <dd>An extension to the {{domxref("Navigator")}} object that returns an array of {{domxref("Gamepad")}} objects, one for each connected gamepad.</dd>
</dl>

<h4 id="Window_events">Window events</h4>

<dl>
 <dt>{{domxref("Window.ongamepadconnected")}}</dt>
 <dd>Represents an event handler that will run when a gamepad is connected (when the {{event('gamepadconnected')}} event fires).</dd>
 <dt>{{domxref("Window.ongamepaddisconnected")}}</dt>
 <dd>Represents an event handler that will run when a gamepad is disconnected (when the {{event('gamepaddisconnected')}} event fires).</dd>
</dl>

<h2 id="Tutoriels_et_guides">Tutoriels et guides</h2>

<ul>
 <li><a href="/en-US/docs/Web/API/Gamepad_API/Using_the_Gamepad_API">Using the Gamepad API</a></li>
 <li><a href="/en-US/docs/Games/Techniques/Controls_Gamepad_API">Implementing controls using the Gamepad API</a></li>
</ul>

<h2 id="Caractéristiques">Caractéristiques</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Spécification</th>
   <th scope="col">Statut</th>
   <th scope="col">Commentaire</th>
  </tr>
  <tr>
   <td>{{SpecName("GamepadExtensions")}}</td>
   <td>{{Spec2("GamepadExtensions")}}</td>
   <td>Defines the {{anch("Experimental Gamepad extensions")}}.</td>
  </tr>
  <tr>
   <td>{{SpecName("Gamepad", "", "The Gamepad API specification")}}</td>
   <td>{{Spec2("Gamepad")}}</td>
   <td>Initial definition</td>
  </tr>
 </tbody>
</table>

<h2 id="Compatibilité_du_navigateur">Compatibilité du navigateur</h2>



<p>{{Compat("api.Gamepad")}}</p>

<h2 id="Voir_également">Voir également</h2>

<ul>
 <li><a href="https://hacks.mozilla.org/2013/12/the-gamepad-api/" rel="nofollow">The Gamepad API</a> by Ted Mielczarek and Robert Nyman</li>
 <li><a href="http://luser.github.io/gamepadtest/">Simple API demo page</a> (<a href="https://github.com/luser/gamepadtest">source</a>)</li>
</ul>