Skip to content

Commit

Permalink
prevent event lockup
Browse files Browse the repository at this point in the history
  • Loading branch information
Keryan-dev committed May 31, 2024
1 parent 68414e9 commit 024f766
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/stubs/ml_canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -1589,10 +1589,10 @@ function ml_canvas_init() {
if (_ml_canvas_initialized === true) {
return 0;
}
document.onkeydown = _key_down_handler;
document.onkeyup = _key_up_handler;
document.onmouseup = _up_handler;
document.onmousemove = _move_handler;
document.addEventListener("keydown", _key_down_handler, {passive: true});
document.addEventListener("keyup", _key_up_handler, {passive: true});
document.addEventListener("mouseup", _up_handler, {passive: true});
document.addEventListener("mousemove", _move_handler, {passive: true});
window.requestAnimationFrame(_frame_handler);
_ml_canvas_initialized = true;
return 0;
Expand Down

0 comments on commit 024f766

Please sign in to comment.