aboutsummaryrefslogtreecommitdiff
path: root/files/ru/web/api/gamepadbutton/pressed/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/ru/web/api/gamepadbutton/pressed/index.html')
-rw-r--r--files/ru/web/api/gamepadbutton/pressed/index.html52
1 files changed, 52 insertions, 0 deletions
diff --git a/files/ru/web/api/gamepadbutton/pressed/index.html b/files/ru/web/api/gamepadbutton/pressed/index.html
new file mode 100644
index 0000000000..5222968bcc
--- /dev/null
+++ b/files/ru/web/api/gamepadbutton/pressed/index.html
@@ -0,0 +1,52 @@
+---
+title: GamepadButton.pressed
+slug: Web/API/GamepadButton/pressed
+translation_of: Web/API/GamepadButton/pressed
+---
+<p>{{APIRef("Gamepad API")}}</p>
+
+<p>Свойство <code><strong>GamepadButton.pressed</strong></code> интерфейса {{domxref("GamepadButton")}} возвращает <code>boolean</code>, указыващий, нажата ли текущая кнопка (<code>true</code>), или нет (<code>false</code>).</p>
+
+<h2 id="Синтакс">Синтакс</h2>
+
+<pre class="syntaxbox notranslate"><span class="idlInterface" id="idl-def-GamepadButton"><span class="idlAttribute">var isPressed = navigator.getGamepads()[0].pressed;
+</span></span></pre>
+
+<h2 id="Пример">Пример</h2>
+
+<pre class="brush: js notranslate">var gp = navigator.getGamepads()[0]; // Get the first gamepad object
+
+if(gp.buttons[0].pressed == true) {
+ // respond to button being pressed
+}</pre>
+
+<h2 id="Значение">Значение</h2>
+
+<p> {{domxref("boolean")}}.</p>
+
+<h2 id="Specifications">Specifications</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName("Gamepad", "#dom-gamepadbutton-pressed", "GamepadButton.pressed")}}</td>
+ <td>{{Spec2("Gamepad")}}</td>
+ <td>Initial definition</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility">Browser compatibility</h2>
+
+<p>{{Compat("api.GamepadButton.pressed")}}</p>
+
+<h2 id="See_also">See also</h2>
+
+<ul>
+ <li><a href="/en-US/docs/Web/Guide/API/Gamepad">Using the Gamepad API</a></li>
+</ul>