Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impl. mouse capturing on web target #1672

Merged
merged 5 commits into from
Aug 29, 2020

Conversation

alvinhochun
Copy link
Contributor

@alvinhochun alvinhochun commented Aug 22, 2020

  • Tested on all platforms changed
  • Compilation warnings were addressed
  • cargo fmt has been run on this branch
  • cargo doc builds successfully
  • Added an entry to CHANGELOG.md if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created or updated an example program if it would help users understand this functionality
  • Updated feature matrix, if new features were added or implemented

Tasks:

  • Implement for web-sys using PointerEvent
  • Implement for web-sys using MouseEvent (Frankly it would be much simpler if winit just requires users to use a PointerEvent polyfill if they want to support browsers with only MouseEvent.)
  • Implement for stdweb using PointerEvent
  • Implement for stdweb using MouseEvent (low priority, might be skipped since MouseEvent support isn't even implemented in the stdweb backend)

Closes #1660

I have also refactored the pointer/mouse handling code a bit for the web-sys target due to it getting quite messy, and it also helps when adding touch event handling later.

The code had been changed for both stdweb and web-sys, but I have only tested with web-sys. Though technically they both use the same web API so their behaviour should not be any different.

@alvinhochun alvinhochun marked this pull request as ready for review August 24, 2020 16:56
@alvinhochun
Copy link
Contributor Author

Hi @ryanisaacg can you please review this PR?

@ryanisaacg
Copy link
Contributor

Sure, I'll review it this weekend. (Btw, in the future feel free to use the Github review request tool. I don't think Github notifies me when a PR goes from draft -> ready for review.)

@chrisduerr
Copy link
Contributor

chrisduerr commented Aug 28, 2020

@ryanisaacg I don't think you can request reviews unless you're a member of rust-windowing. You can only re-request reviews iirc.

@ryanisaacg
Copy link
Contributor

That is an odd design choice on the part of Github. Feel free to ping me for reviews instead, I suppose!

@ryanisaacg ryanisaacg merged commit 02a34a1 into rust-windowing:master Aug 29, 2020
@daxpedda daxpedda mentioned this pull request Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Mouse/pointer not captured when dragging out of the canvas area on web target
3 participants