Fix keypress event