From 074785cea106179cb3305637055ab0a009ca74f2 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:52 -0500 Subject: initial commit --- files/ru/web/api/gamepadbutton/pressed/index.html | 52 +++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 files/ru/web/api/gamepadbutton/pressed/index.html (limited to 'files/ru/web/api/gamepadbutton/pressed') 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 +--- +

{{APIRef("Gamepad API")}}

+ +

Свойство GamepadButton.pressed интерфейса {{domxref("GamepadButton")}} возвращает boolean, указыващий, нажата ли текущая кнопка (true), или нет (false).

+ +

Синтакс

+ +
var isPressed = navigator.getGamepads()[0].pressed;
+
+ +

Пример

+ +
var gp = navigator.getGamepads()[0]; // Get the first gamepad object
+
+if(gp.buttons[0].pressed == true) {
+  // respond to button being pressed
+}
+ +

Значение

+ +

 {{domxref("boolean")}}.

+ +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName("Gamepad", "#dom-gamepadbutton-pressed", "GamepadButton.pressed")}}{{Spec2("Gamepad")}}Initial definition
+ +

Browser compatibility

+ +

{{Compat("api.GamepadButton.pressed")}}

+ +

See also

+ + -- cgit v1.2.3-54-g00ecf