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

Implement Serialize and Deserialize for gamepad events #5979

Closed
alice-i-cecile opened this issue Sep 13, 2022 · 2 comments
Closed

Implement Serialize and Deserialize for gamepad events #5979

alice-i-cecile opened this issue Sep 13, 2022 · 2 comments
Labels
A-Input Player input via keyboard, mouse, gamepad, and more C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy

Comments

@alice-i-cecile
Copy link
Member

What problem does this solve or what need does it fill?

This is useful for input capture and playback of gamepad events, enabling automated testing and advanced input mocking.

What solution would you like?

Derive Serialize and Deserialize for GamepadEvent, GamepadEventRaw, Gamepad, GamepadButtonType and GamepadAxisType.

What alternative(s) have you considered?

Use Serde's https://serde.rs/remote-derive.html in an external crate.

Additional context

This should also likely be done for WindowEvent upstream in winit, but that's likely blocked on rust-windowing/winit#1387

@alice-i-cecile alice-i-cecile added D-Trivial Nice and easy! A great choice to get started with Bevy A-Input Player input via keyboard, mouse, gamepad, and more C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Sep 13, 2022
@object71
Copy link
Contributor

object71 commented Sep 14, 2022

Gamepad structs seems to have this behind a feature called serialize #[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))].

@alice-i-cecile
Copy link
Member Author

Ah right! I've made these exact mistake before...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Input Player input via keyboard, mouse, gamepad, and more C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy
Projects
None yet
Development

No branches or pull requests

2 participants