Input handling

@Fearswe 

If it looks fine, go ahead and merge it (but don't close it yet) so we have the basic idea in *master*.