Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add InputEvent<T> to StateEvent #1148
By default, users and amethyst examples are using the winit VirtualKeyCode to handle keyboard events. This should be changed to show goos pratices by using the events coming out of the EventChannel<InputEvent> in State::handle_event. To be able to do this, there will need to be a variant Input(InputEvent) added to StateData. The generic type on StateData should default to String.
I'll rephrase what I raised in another issue here.
If this is implemented we would have two places where we handle input events. For documentation purposes, and to reduce confusion, I'd like clarification on what is expected to be handled where. Or that we have a clear signal what the preferred way of handling input is.
I prefer handling all input in systems. There is a clearly defined data dependency, and the handler is managed by the ECS like almost everything else. I'm curious what others think about this.
referenced this issue
Nov 17, 2018
This discussion seems more about the general event handling story. Maybe this should be discussed in the forum or in another thread (to later be merged as an RFC). We should try to agree on a consistent event handling story, update the engine accordingly and document it.