Speedy2D
Speedy2D copied to clipboard
Added mouse passthrough window option
Closes https://github.com/QuantumBadger/Speedy2D/issues/68
Turns out bumping the version of glutin
to 0.29.1 makes this function available:
self.window_context.window().set_cursor_hittest(!passthrough).unwrap();
which makes mouse passthrough events possible.
WindowCreationOptions
now has .with_mouse_passthrough(bool)
However with then newer version of Glutin, cursor grab is changed from a bool to an enum CursorGrabMode
.
I did a somewhat ugly hack for this so I might need some advice on the best way to fix it up.
Thank you, and sorry for the delay in reviewing!
I've tested this on Linux and unfortunately, even if the user doesn't enable passthrough, this crashes every time with
SetMousePassthroughFailed
. I think to fix this, we should only invoke the set_cursor_hittest
API if the user has enabled options.mouse_passthrough
-- otherwise we should just not invoke the API.
Otherwise this looks great, I think it should be possible to merge this with the above change. Thanks again!
Sorry for bumping up this old thread, but I wanted to create an overlay and there really isn't much options. Is this planned to be supported?
I'm also using Speedy2D in hopes of making a quick & dirty overlay and while not a total blocker (pun unintended) it would be a big improvement if the overlay could be made passthrough.
I saw in #99 that the reason the examples don't compile is because they are for 2.0 which has yet-to-release. Is this something that is maybe addressed by 2.0?
I noticed in master the glutin
version has been updated to 0.31.3, any change of this being revisited now that Speedy2D is using a version which should support it?
Same request here, I use it as well for a quick and dirty overlay and passthrough would be great :)