Question

I have just added in Tab as a control in my project and every time the Tab key is pressed it jumps the address bar once I try to do another key press. This happens only after Tab does what it's supposed to in the scene. How would I go about fixing this? Is this due to the fact that I'm running the program from a windows path and not a web address?

Was it helpful?

Solution

Try preventDefault:

document.addEventListener("keydown", function(e) {
    e.preventDefault(); //prevent default event action

    //do your stuff
    var iKeyCode = e.keyCode;

    console.log("keydown: ", iKeyCode);

}, false);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top