document.addEventListener('keydown', function(e) { console.log(e.keyCode); }, false);
keycode 37 = Left
keycode 38 = Up
keycode 39 = Right
keycode 40 = Down
参考:https://www.cnblogs.com/exmyth/p/3510560.html
removeEventListener:https://blog.csdn.net/weixin_33941350/article/details/91384546