add key event handler