Skip to content

Web: Only Use PointerEvent for Touch#2731

Closed
JAD3N wants to merge 4 commits intorust-windowing:masterfrom
JAD3N:fix-web-mouse-events
Closed

Web: Only Use PointerEvent for Touch#2731
JAD3N wants to merge 4 commits intorust-windowing:masterfrom
JAD3N:fix-web-mouse-events

Conversation

@JAD3N
Copy link
Copy Markdown

@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
Copy Markdown
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 added the DS - web Affects the Web backend (WebAssembly/WASM) label May 28, 2023
@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
Copy Markdown
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
Copy Markdown
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 Affects the Web backend (WebAssembly/WASM)

Development

Successfully merging this pull request may close these issues.

2 participants