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/value/index.html | 51 +++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 files/ru/web/api/gamepadbutton/value/index.html (limited to 'files/ru/web/api/gamepadbutton/value/index.html') diff --git a/files/ru/web/api/gamepadbutton/value/index.html b/files/ru/web/api/gamepadbutton/value/index.html new file mode 100644 index 0000000000..a1ccad261f --- /dev/null +++ b/files/ru/web/api/gamepadbutton/value/index.html @@ -0,0 +1,51 @@ +--- +title: GamepadButton.value +slug: Web/API/GamepadButton/value +translation_of: Web/API/GamepadButton/value +--- +

{{APIRef("Gamepad API")}}

+ +

Свойство GamepadButton.value  интерфейса {{domxref("GamepadButton")}} возвращает состояние аналоговой клавиши геймпада, такой, как, например триггеры. 

+ +

Пердставляет собой дробное число в диапазоне  0.01.0,  где 0.0 показывает, что кнопка не нажата, а 1.0 - что нажата полностью.

+ +

Синтаксис

+ +
    readonly    attribute double  value;
+ +

Пример

+ +
var gp = navigator.getGamepads()[0];
+
+if(gp.buttons[0].value > 0) {
+  // respond to analog button being pressed in
+} 
+ +

Значение

+ +

 {{domxref("double")}}.

+ +

Specifications

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

Browser compatibility

+ +

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

+ +

См. также

+ +

Using the Gamepad API

-- cgit v1.2.3-54-g00ecf