Clean keypress logic