gobot
gobot copied to clipboard
Added ability to select a joystick by name
Tihs PR adds a new Adaptor constructor for creating a joystick by implementation-specific name.
relates to #564
Hello @theunkn0wn1 thank you for the contribution.
How does the naming work if you have 2 of the same joysticks connected?
Could you please add an example of how you would use this with 2 joysticks? Ideally this would be in the godocs comments for the new constructor.
To my understanding, this implementation has the same inherent flaw as the constructor it replaces, this implementation will always return the first of the two same-model joysticks as the underlying SDL2 library reports them. As I don't have two of the same joystick to compare against, im not sure what other identifiers on a joystick may be more unique we could base the constructor on.
I will happily provide godoc formatted examples, though I appear to be having a hard time finding the relevant documentation. :man_facepalming: Can you provide me a link for working with godoc?
@theunkn0wn1 because there is no answer yet by @deadprogram, I will try to give some help.
IMO there is no specific format for the first raw documentation needed. Just have a look at some other documentation of constructors in gobot. If there any developer/user is unsure about the correct use he will have a look into some test code or even an example (e.g. gobot/examples/*). Unit tests in general are very helpful.
thanks @gen2thomas for a reply. The lack of activity on this PR caused me to completely forget it hadn't been seen to. I have long since moved on from golang in general, so this PR is now offered as-is.
@theunkn0wn1 thanks for the reply. So I will set it to draft as a reference.
accidentally closed - now reopen