found a tutorial on detecting keypress