Skip to content

Commit

Permalink
Use requestanimationframe and fix keyboard input
Browse files Browse the repository at this point in the history
  • Loading branch information
s-macke committed Jan 3, 2020
1 parent 6ba56cf commit 60d7ae1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions VoxelSpace.html
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@
updaterunning = false;
} else
{
window.setTimeout(Draw, 0);
window.requestAnimationFrame(Draw, 0);
}
}

Expand Down Expand Up @@ -522,8 +522,8 @@

// set event handlers for keyboard, mouse, touchscreen and window resize
var canvas = document.getElementById("fullscreenCanvas");
canvas.onkeydown = DetectKeysDown;
canvas.onkeyup = DetectKeysUp;
window.onkeydown = DetectKeysDown;
window.onkeyup = DetectKeysUp;
canvas.onmousedown = DetectMouseDown;
canvas.onmouseup = DetectMouseUp;
canvas.onmousemove = DetectMouseMove;
Expand Down

0 comments on commit 60d7ae1

Please sign in to comment.