Skip to content
Permalink
Browse files

listen for mouse up on document (fixes mouseup outside canvas)

  • Loading branch information
Daft-Freak committed Sep 13, 2016
1 parent cd05184 commit a2ef0db8a8c50fea3cfbbeb475a9f229753e1a0b
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/video/emscripten/SDL_emscriptenevents.c
@@ -553,7 +553,7 @@ Emscripten_RegisterEventHandlers(SDL_WindowData *data)
emscripten_set_mousemove_callback("#canvas", data, 0, Emscripten_HandleMouseMove);

emscripten_set_mousedown_callback("#canvas", data, 0, Emscripten_HandleMouseButton);
emscripten_set_mouseup_callback("#canvas", data, 0, Emscripten_HandleMouseButton);
emscripten_set_mouseup_callback("#document", data, 0, Emscripten_HandleMouseButton);

emscripten_set_mouseenter_callback("#canvas", data, 0, Emscripten_HandleMouseFocus);
emscripten_set_mouseleave_callback("#canvas", data, 0, Emscripten_HandleMouseFocus);
@@ -590,7 +590,7 @@ Emscripten_UnregisterEventHandlers(SDL_WindowData *data)
emscripten_set_mousemove_callback("#canvas", NULL, 0, NULL);

emscripten_set_mousedown_callback("#canvas", NULL, 0, NULL);
emscripten_set_mouseup_callback("#canvas", NULL, 0, NULL);
emscripten_set_mouseup_callback("#document", NULL, 0, NULL);

emscripten_set_mouseenter_callback("#canvas", NULL, 0, NULL);
emscripten_set_mouseleave_callback("#canvas", NULL, 0, NULL);

0 comments on commit a2ef0db

Please sign in to comment.