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

Web: Only Use PointerEvent for Touch #2731

Closed
wants to merge 4 commits into from
Closed

Web: Only Use PointerEvent for Touch #2731

wants to merge 4 commits into from

Conversation

JAD3N
Copy link

@JAD3N JAD3N commented Mar 12, 2023

  • Tested on all platforms changed
  • 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

This builds on top of #2721 by making the mouse handler be the way to handle mouse events instead of pointer. Pointer events are still conditionally used (depending on browser support) for touch events.

By doing this it should resolve issue #2475 as pointer events don't trigger events for mouse buttons pressed while another mouse button is being held. More information can be found here but the main concern is in the first paragraph:

For mouse, it is fired when the device transitions from no buttons pressed to at least one button pressed.

@JAD3N JAD3N changed the title Web: Use MouseEvent instead of PointerEvent Web: Only Use PointerEvent for Touch Mar 12, 2023
@JAD3N
Copy link
Author

JAD3N commented Mar 20, 2023

Currently I've left all mouse event handlers in mouse_handler.rs but it might be merge that into canvas.rs and add a new handler for touch events as touch_handler.rs and use that as a fallback if pointer events aren't available.

@daxpedda daxpedda self-assigned this May 28, 2023
@daxpedda daxpedda added the C - waiting on maintainer A maintainer must review this code label May 28, 2023
@daxpedda
Copy link
Member

This is definitely still a problem even after #2662, I will review this soon.

You don't need to rebase it until I review the approach to this.

@daxpedda
Copy link
Member

daxpedda commented Jun 2, 2023

I replaced this by #2838.

When a pointer button is already pressed, new button presses/releases won't go through pointerdown/pointerup, but through pointermove, [..]

So we shouldn't need to handle both events.

@daxpedda daxpedda closed this Jun 2, 2023
@JAD3N JAD3N deleted the fix-web-mouse-events branch June 2, 2023 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C - waiting on maintainer A maintainer must review this code DS - web
Development

Successfully merging this pull request may close these issues.

2 participants