avarsh / ape2d

A data driven, entity-component-system based 2D game engine.
MIT License
0 stars 0 forks source link

Better input system #11

Open avarsh opened 5 years ago

avarsh commented 5 years ago

An input system is essential to the engine. Initially, it should support keyboard and mouse input. The approach taken will be similar to the one described in this article. Essentially, a "context" will be a mapping of low level hardware commands to callbacks which are executed. Multiple contexts can exist in the system, with priorities. Any input cascades down the context chain. A context can either observe the input signal and pass it on to the next context or can eat the signal, in order to prevent multiple actions occurring on one input.