title: What is "onkeyup" in gamepad api?
body: <p>I'm experimenting a little with gamepad api. When a button is pressed, it gets &quot;fired&quot; all the time until the button is released. This is cool for something like running or shooting in a game, but problematic, when I want to navigate inside a menu (e.g. going 16 menu items down instead of one).</p>
  <p>On a normal keyboard, I would use onkeyup/onkeydown to see, when a button press has ended. But on gamepad api, I didn't find something like that.</p>
  <p>JS:</p>
  <pre><code>var gamepadPressCounter = 0;
  
  function update() {
    const gamepads = navigator.getGamepads();
    if (gamepads[0].buttons[0].pressed === true)  {
      gamepadPressCounter++;
    }
    window.requestAnimationFrame(update);
  }
  </code></pre>
  <p>So, do you know a way to get the gamepadPressCounter only one up per press and not infinite times?</p>