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

Touch input only works in certain browsers #526

Closed
jakmeier opened this issue Aug 9, 2019 · 2 comments
Closed

Touch input only works in certain browsers #526

jakmeier opened this issue Aug 9, 2019 · 2 comments

Comments

@jakmeier
Copy link

jakmeier commented Aug 9, 2019

Hello, and thank you for your work on this crate, it has been of great help for me and very easy to use!

I have a minor bug report, affecting the wasm target and only in certain browsers.
A PR with a suggestion for a fix will follow.

Describe the bug
In some mobile browsers, a touch input does not trigger any quicksilver events, as it would be expected since #429 has been merged and #366 closed.
The problem with the current implementation is that it relies on PointerEvents from the browser such as pointermove and pointerdown. Unfortunately, these events are not implemented by all mobile browsers.

The result is that nothing happens on touching the screen, when using an affected browser, while in others a MouseClick / MouseMove event is triggered.

To Reproduce
The best way to reprocude is with Firefox on mobile and WebIDE, printing all events to the console.
Firefox has an option in about:config called dom.w3c_pointer_events.enabled. Without reloading, changing this flag will either show mouse click events on touches or not.

Environment and versions (please complete the following information):

  • Environment: Problem occurs in these browsers:
    • Firefox on Android, version >= 29 (with default settings)
    • Safari on iOS
    • Samsung Internet
    • Maybe also in Opera for Android
  • Rust compiler version: Not relevant, bug is specific to web
  • Quicksilver version: latest (0.3.18)

Solution:
I have already a local branch which fixes this bug. I will reference this issue and submit a PR immediately.

jakmeier added a commit to jakmeier/quicksilver that referenced this issue Aug 9, 2019
This commit fixes single touch input for a number of mobile browsers.
It uses TouchEvents and MouseEvents instead of PointerEvents only,
which is necessary in mobile FF, Opera, Safari, and Samsung Internet.

Resolves ryanisaacg#526
@jakmeier
Copy link
Author

I forgot to mention it above but actually the touch input seemed to be buggy in all browsers before. The mouse position on the quicksilver window has not been updated on a PointerDown event, therefore the click event provided by quicksilver has not really been useful since the correct position is inaccessible at this point. (When a finger taps the screen at a single location, no MoveEvents are generated)

Since I figured this out while fixing the other issue, I forgot to mention it. But it is probably the bigger problem since it affects more browsers.

#527 fixes both bugs

@ryanisaacg
Copy link
Owner

Closing in favor of rust-windowing/winit#1286, because future versions of Quicksilver will be using Winit's web backend instead of its own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants