Closed Clinery1 closed 2 years ago
What solution would you prefer?
I think that just the documentation update is the better option.
This page, 2 occurences, right? https://github.com/NicoHood/HID/wiki/Gamepad-API
That is correct.
Done. Close if it is okay for you. Thanks for reporting
Problem
In the wiki, the
Gamepad
press
andrelease
functions say buttons0..31
, but the actual API accepts1..32
.Solution 1
Change the documentation to say
[1 .. 32]
instead of[0 .. 31]
.Solution 2
Change the
Gamepad
API to support the buttons starting from 0 instead of 1.How to recreate
This snippet of code will (according to gamepad-tester.com) report
button0
when eitherbutton0
orbutton1
are pressed. Tested on an Arduino Leonardo and Linux 5.17.If the
press(0)
is changed to apress(1)
and thepress(1)
to apress(2)
, then gamepad-tester will report button 0 and 1 being pressed.