I want to use the numpad keycodes in my webpage, but there are already predefined functions for the numpad keys.
For example, numpad key 4 referes to the keycode actions for the left arrow instead of just doing nothing. So I am just searching for optional some javascript code which deactivates those functions and allows numpad inputs to "other functions"/keycodes.
It would be great if there would be something like this:
window.allownumpad = false;
I already tried:
addEventListener("keydown", function (e) {
e.preventDefault();
}, false);
I thought about making a javascript canvas - game with 2 players... So the controls would be like: first player [WASD] and second: [n4n8n5n6] (Please no answers like: "why dont you use the arrows?!"). Thank you for reading/answering! :)