Skip to content
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

Merge the input method specific *Virtual* types into general Virtual* types #632

Closed
FlooferLand opened this issue Sep 17, 2024 · 3 comments
Labels
code-quality Make the code faster or prettier usability Reduce user friction

Comments

@FlooferLand
Copy link

Made from #631 (comment)

Which code could be improved?

src/user_input/keyboard.rs

src/user_input/mouse.rs

src/user_input/gamepad.rs

How should this be changed?

Having several types for each input method doesn't make much sense here and tends to clutter things.
For example, there is no MouseVirtualAxis type right now because it wasn't taken into count, even though I believe the mouse buttons implement Buttonlike.

These ~6 structs could be merged into 3 simpler types: VirtualAxis VirtualDPad, VirtualDPad3d
The implementation would probably use generics and Buttonlike

@FlooferLand FlooferLand added the code-quality Make the code faster or prettier label Sep 17, 2024
@alice-i-cecile alice-i-cecile added the usability Reduce user friction label Sep 17, 2024
@alice-i-cecile
Copy link
Contributor

@FlooferLand FYI, the reason why you were getting the "KeyCode does not implement Buttonlike" error is because of the various feature flags:

Feel free to open a draft PR and ask for help from myself and the community there :)

@Shute052
Copy link
Collaborator

@FlooferLand
Copy link
Author

Yes! Exactly what i was looking for.
I will close this now, hopefully that PR gets merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-quality Make the code faster or prettier usability Reduce user friction
Projects
None yet
Development

No branches or pull requests

3 participants