Deal with badly behaving keypress events better