Currently the input handling uses platform-dependent keycode and indices. It would be better to have a implementation-independent API for common buttons/triggers/analog sticks.
TODO list:
[x] Button API
Should provide common buttons like A, B, X, Y, LButton, RButton, LTrigger, RTrigger, Lstick, RStick, Home, Select, Start.
If there are multiple D-pads, use the most common one (depends on the implementation).
[x] Analog stick API (left and right)
If there are more than two sticks, method of interfacing with the rest would be implementation-dependent.
Possible value ranges from 0 to 255. Any controllers that internally use different value mapping shall implement conversions between the universal value and the internal value.
[x] Trigger API
Can also be set via the button API using the same code.
Trigger value ranges from 0 to 255
When the state was set to pressed via the button API, set the analog value to maximum and the digital value to 1 (if possible).
When the state was set to released via the button API, set the analog value to minimum and the digital value to 0 (if possible).
When the state was set by the trigger API, map the analog value to the supplied value. If the supplied value is 0, set the digital value to 0, otherwise set it to 1.
Currently the input handling uses platform-dependent keycode and indices. It would be better to have a implementation-independent API for common buttons/triggers/analog sticks.
TODO list:
A, B, X, Y, LButton, RButton, LTrigger, RTrigger, Lstick, RStick, Home, Select, Start
.A, B, X, Y
) uses Nintendo-style layout (Super Famicom/SNES)pressed
via the button API, set the analog value to maximum and the digital value to 1 (if possible).released
via the button API, set the analog value to minimum and the digital value to 0 (if possible).