-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
Controller events #29
Conversation
This looks like a great start! Thank you @JohnDoneth! I see that integrating with Gilrs is simpler than I thought. Great! However, before merging this, I think we should work on an example showcasing how to use this properly. Some usage code will give us some confidence that the API is not lacking some essential functionality.
I see. Maybe we could add the cached
Is this a Gilrs bug? Or is it expected? Thank you again for your work. |
I completely agree! I'll push what I have so far for, for the example, which is just a window displaying the latest event as a string. My idea was to add some sort of visualization like a gamepad with pushed buttons highlighted or something similar.
Oh right! I completely forgot about the
I'm not sure, it's just what I experienced under Linux. I'm going to test on Windows and see if the implementations differ in emitted events. |
…ffee into controller-support
I've hit a snag where the previously discussed GamepadState doesn't implement |
I see, maybe we could drop those for the What is the |
@JohnDoneth I am working on this. I will create a PR in your fork once I have something working. |
@hecrj Sounds good, I'll be looking out for it! 👍 |
I've ended up pushing the changes directly to this branch because making a PR showed a lot of changes from Take a look and let me know what you think. All that's left is to implement We could also create a |
7fc770c
to
a99c935
Compare
All right, this should be ready! I have changed the Each one of these sources has a module inside Finally, I have changed the |
Thanks for finishing this up! I just took a look. I really like the splitting of input into input sources; I think that makes a lot of sense intuitively. |
@JohnDoneth You started it! Thank you again for all your work! 🚀 |
I've made some changes to essentially inject GilRs gamepad events as input events and added GilRs as a dependency.
Currently, there's no way to poll the gamepad directly as everything is event-based. This was a blocker for me to add a nice example but the basics are there and should suffice for handling simple events and button presses.
A catch I encountered is that if an axis event occurs there won't be the following event to "zero" that same axis out, so caching the state of an axis won't work.
This PR, or future PR's could expose more of the GilRs API such as querying the power state and allowing the use of the force-feedback module.
Edit:
Currently, these changes expose two GilRs types (
GamepadId
andEventType
) which may not be preferable.