You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was hoping to use this library for a menu that can potentially get pretty long and would like to allow the user to hold directions on the d-pad to navigate it as an alternative to repeatedly tapping the directional button.
This works fine with the analog stick since holding the stick in any direction continuously sends the axis_move event. But holding a directional button only sends the button_press event once.
So I am requesting events to be added to determine when a button is being held and then released.
The text was updated successfully, but these errors were encountered:
I realized later on that I could just start an interval on the button_press event to check the button status periodically to check if it's still pressed.
This can certainly be done. But since the requestAnimationFrame loop is already listening for button events, maybe we can track and dispatch a hold event as well in the same loop. Let me see what can be done. For now, the setInterval approach should work fine.
Seems to me a decent implementation would fire both a "pressed" and "down" event when the button is first noticed to be pressed, and after monitoring every frame, if it's no longer pressed an "up" gets fired. Does that sound reasonable?
I was hoping to use this library for a menu that can potentially get pretty long and would like to allow the user to hold directions on the d-pad to navigate it as an alternative to repeatedly tapping the directional button.
This works fine with the analog stick since holding the stick in any direction continuously sends the axis_move event. But holding a directional button only sends the button_press event once.
So I am requesting events to be added to determine when a button is being held and then released.
The text was updated successfully, but these errors were encountered: