Added keyboard behaviour. Seperated out the input.

Brb.... Too tired to write this.