Be a Supporter!
Response to: Arrow keys move the browser up/down Posted November 15th, 2014 in Programming

At 11/15/14 04:41 PM, Diki wrote:
document.addEventListener("keydown", function(event){
if (event.keyCode >= 37 && event.keyCode <= 40) {
event.preventDefault();
}
});

Thank you so much, Diki. Your code worked perfectly. I appreciate your help.

Response to: Arrow keys move the browser up/down Posted November 15th, 2014 in Programming

At 11/15/14 03:08 AM, coln wrote: It appears that the answer can be found by using an event's .preventDefault() method. A little searching came up with this result. Some of the script might be a little confusing for a beginner to understand, so if you have any questions about it feel free to post back here.

Thank you for your help and for the link. I appreciate it! I got it to working with Diki's code.

Arrow keys move the browser up/down Posted November 14th, 2014 in Programming

Hello. I'm new here, so please forgive me if this has been answered before. In my game that I uploaded here, the space ship is controlled with the arrow keys. But if you use these keys, the browser window goes up and down. Is there a way to fix this? Thank you for your help.