HTML5-JavaScript-Gamepad-Controller-Library
HTML5-JavaScript-Gamepad-Controller-Library copied to clipboard
mapping of buttons
how can I make mappings ? is there any guide or tutorial ?? an example maybe ?!
Heya! Do you mean to create a mapping for a controller/setup that isn't covered by one of the existing? It's essentially a manual task:
- You make/use a simple test application that prints the event values from the controller library.
- Refer to the standard controller mapping
- For each button (done in the standard sequence) ** Press button ** Note the notified button index ** Use that notified index as the value of the new mapping
- To something similar with the axes
The value from the browser event is taken and used as an index into the mapping table to retrieve the to-be-reported value. So, if for the expected button 0 the reported value is 10 (based on the standard mapping), then this means that the browser event had a value of 10. In your new mapping, put a 0 at index 10 in the mapping.