Refactored the KeyboardInput sample

- Also fixed a bug where key presses where not registering correctly