I am creating a game in which you can hold down the mouse button and drag it around to rotate an object. However, when the mouse position is outside the borders of the page, all mouse events are no longer triggered. This means that the object no longer rotates when the cursor is outside the page; in addition, when the user releases the mouse outside the borders of the page, I can’t keep track of what it means that the object is still rotating when the cursor returns to the borders of the page, although it is no longer pressed.
So, is there a way to make the mousemove / mousedown / mouse [...] events fire when the cursor is outside the borders of the page?
source
share