Please note that there have been some changes and it is advised that you use key instead of keyCode.

To get the key press event key value use the key which is ArrowLeft, ArrowUp, ArrowRight, ArrowDown

Enter = 13

ArrowLeft = 37

ArrowUp = 38

ArrowRight = 39

ArrowDown = 40

The below code will track keypress and show the key vs the keyCode.

    <script>
        window.addEventListener("keydown", function (e) {
            let key = e.key;
            console.log(e.key + ' = ' + e.keyCode);
        })
    </script>