-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added ability to select a joystick by name #732
base: dev
Are you sure you want to change the base?
Conversation
- based on hybridgroup#564 (comment) Signed-off-by: joshua salzedo <[email protected]>
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. 🤦♂️ 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. |
@theunkn0wn1 thanks for the reply. So I will set it to draft as a reference. |
accidentally closed - now reopen |
Tihs PR adds a new Adaptor constructor for creating a joystick by implementation-specific name.
relates to #564