CCGSRobotics / RoboHUD

The RoboHUD GUI stack developed by CCGS Robotics
https://robohud.readthedocs.io
MIT License
10 stars 4 forks source link

Controller nodes often merge physical buttons #75

Open Finchiedev opened 4 years ago

Finchiedev commented 4 years ago

A common bug with the HTML5 Gamepad API is that it sometimes merges multiple buttons into one node (which is hard to prevent given the scope of the API). To combat this, we could let the user split the single node into child nodes of the parent, each with their own range that gets normalized into a percentage.

For example: D-Pad has 4 buttons but the Gamepad API assigns left+right & up+down into 2 nodes. Given that the left+right node goes to 0 when the left button is pressed, 1 when the right button is pressed and 0.5 when no button is pressed, the user can specify that the node should be split in two: