simplified the keypress event selector