--- title: GamepadButton.value slug: Web/API/GamepadButton/value translation_of: Web/API/GamepadButton/value --- <p>{{APIRef("Gamepad API")}}</p> <p>Свойство <code><strong>GamepadButton.value</strong></code> интерфейса {{domxref("GamepadButton")}} возвращает состояние аналоговой клавиши геймпада, такой, как, например триггеры. </p> <p>Представляет собой дробное число в диапазоне <code>0.0</code> — <code>1.0</code>, где <code>0.0</code> показывает, что кнопка не нажата, а 1.0 - что нажата полностью.</p> <h2 id="Синтаксис">Синтаксис</h2> <pre class="syntaxbox"><span class="idlInterface" id="idl-def-GamepadButton"><span class="idlAttribute"> readonly attribute <span class="idlAttrType">double</span> <span class="idlAttrName">value</span>;</span></span></pre> <h2 id="Пример">Пример</h2> <pre class="brush: js">var gp = navigator.getGamepads()[0]; if(gp.buttons[0].value > 0) { // respond to analog button being pressed in } </pre> <h2 id="Значение">Значение</h2> <p> {{domxref("double")}}.</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-value", "GamepadButton.value")}}</td> <td>{{Spec2("Gamepad")}}</td> <td>Initial definition</td> </tr> </tbody> </table> <h2 id="Browser_compatibility">Browser compatibility</h2> <p>{{Compat}}</p> <h2 id="Смотрите_также">Смотрите также</h2> <p><a href="/en-US/docs/Web/Guide/API/Gamepad">Using the Gamepad API</a></p>