Fix a bug with onkeydown event arrow key code detection