Fix keydown event problem