web; runtime; add browser_window_mouse(down|up|move) #101
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These options allow to handle mouse events (down, move, up) in the entire browser window instead of just the canvas. It makes it possible to track a started mouse event outside the canvas and finish it inside it and vice versa.
I needed this because I embed a luxe view inside a bigger html page and need to keep track of what the mouse is doing outside the canvas. Before that, when starting a
mousedown
event in the canvas (to drag/select/move something) and releasing the mouse buttonmouseup
outside the canvas, the app would still think my mouse is pressed when it isn't. These options make it possible to handle it nicely.These options are disabled by default. If enabled, I didn't foresee any regression regarding computing event positions as
snow
is not using MouseEvent values that depend on which element it was captured from anyway. Only window level values, then translating to canvas positions.