You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to add conversions between VirtualKeyCode and &str. This is something we added to our project [1] to be able to serialize them to a file and that you previously suggested in issue #842. I decided to open an issue so we can agree on an implementation before I start working on it.
I would implement the Default (which automatically provides ToString) and FromStr traits on VirtualKeyCode. This can be done trivially using the strum crate (https://crates.io/crates/strum). Alternatively we can write the conversion manually for each variant at the cost of more boilerplate code.
Hi,
I would like to add conversions between VirtualKeyCode and &str. This is something we added to our project [1] to be able to serialize them to a file and that you previously suggested in issue #842. I decided to open an issue so we can agree on an implementation before I start working on it.
I would implement the Default (which automatically provides ToString) and FromStr traits on VirtualKeyCode. This can be done trivially using the strum crate (https://crates.io/crates/strum). Alternatively we can write the conversion manually for each variant at the cost of more boilerplate code.
[1] https://gitlab.com/veloren/game/blob/master/voxygen/src/keybinds.rs#L82
Thanks,
Sébastien
The text was updated successfully, but these errors were encountered: