make keystroke entry robust