Updating keyboard code to handle multiple platforms. Right now it only works on keypress not keydown.