Add input event DAG

This PR adds code for hotkey recognition and event emission.
Still WIP, but you can review the code that is present now.
Targets #321.
Mh... I was going to have a extensive documentation about this. Looks like it will be rather sooner than later...