Add mouse events to the document object so that the canvas correctly gets notified by MouseUp/MouseMove events even if the mouse cursor is outside of the canvas.