initial keypress handling for input and menu