How do you program something to respond to a keyboard command in a function?