Responds to key input