Respond to keypresses in autocomplete