Question

I'm making a game using canvas, and javascript.

When the page is longer than the screen (comments, etc.) pressing the down arrow scrolls the page down, and makes the game impossible to play.

What can I do to prevent the window from scrolling when the player just wants to move down?

I guess with Java games, and such, this is not a problem, as long as the user clicks on the game.

I tried the solution from: How to disable page scrolling in FF with arrow keys ,but I couldn't get it to work.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top