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

This commit is contained in:
Charlie Birks 2016-09-13 00:03:37 -07:00
parent cd05184f9b
commit a2ef0db8a8
1 changed files with 2 additions and 2 deletions

View File

@ -553,7 +553,7 @@ Emscripten_RegisterEventHandlers(SDL_WindowData *data)
emscripten_set_mousemove_callback("#canvas", data, 0, Emscripten_HandleMouseMove); emscripten_set_mousemove_callback("#canvas", data, 0, Emscripten_HandleMouseMove);
emscripten_set_mousedown_callback("#canvas", data, 0, Emscripten_HandleMouseButton); 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_mouseenter_callback("#canvas", data, 0, Emscripten_HandleMouseFocus);
emscripten_set_mouseleave_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_mousemove_callback("#canvas", NULL, 0, NULL);
emscripten_set_mousedown_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_mouseenter_callback("#canvas", NULL, 0, NULL);
emscripten_set_mouseleave_callback("#canvas", NULL, 0, NULL); emscripten_set_mouseleave_callback("#canvas", NULL, 0, NULL);