PistonDevelopers / piston

A modular game engine written in Rust
https://www.piston.rs
MIT License
4.62k stars 234 forks source link

Move `Custom` to `Input` #1323

Closed bvssvni closed 5 years ago

bvssvni commented 5 years ago

See https://github.com/PistonDevelopers/piston/issues/1322

Currently, it is not possible for window backends to push custom events, since they are expected to return Input and not Event. This was a design error that appeared under a previous refactoring.

By moving Custom to Input, the problem should be solved.

po-stulate commented 5 years ago

A following up question, is there any plan for supporting raising events at application level? Which means a non window backend specific mechanism for event pushing. Since it can be a common situation that the event is not input/hardware related and may vary over application code. The current solution for event handling is more like a input-driven style, it does work well with applications that updates rely on inputs, but not really much for others.

bvssvni commented 5 years ago

Closed in favor of https://github.com/PistonDevelopers/piston/issues/1324

@PoYen000227 please open up an separate issue if you want to discuss raising events at application level.