HTML5-JavaScript-Gamepad-Controller-Library icon indicating copy to clipboard operation
HTML5-JavaScript-Gamepad-Controller-Library copied to clipboard

mapping of buttons

Open antag0n1st opened this issue 11 years ago • 1 comments

how can I make mappings ? is there any guide or tutorial ?? an example maybe ?!

antag0n1st avatar Oct 25 '14 16:10 antag0n1st

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.

dertseha avatar Nov 05 '14 20:11 dertseha