Add keypress event handler