-
Notifications
You must be signed in to change notification settings - Fork 920
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 touch event #2188
Web touch event #2188
Conversation
I resolved the conflicts. |
Also, I update the demo with the latest code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for reviewing! |
@ryanisaacg Could you review this and suggest another reviewer for this? |
I haven't been involved in any winit development for a few years at least; I'm not a good reviewer any longer. (Besides, it does look like you have an approving review?) |
One weird thing, the y axis seems inverted - needs to be height - y. Top left should be 0,0. egui touch handling and my brain expects this, but it seems that bottom left is currently 0,0. |
Oh, I may misunderstand the treatment of the y-axis in winit. https://docs.rs/winit/latest/winit/event/enum.WindowEvent.html#variant.CursorMoved
So we don't need y-axis flipping? |
Personally I don’t think so. Have you got a second flip that offsets it in
the web demo? Just wondering why that one works.
…On Sun, 13 Nov 2022 at 06:36, Ryo Hirayama ***@***.***> wrote:
Oh, I may misunderstand the treatment of the y-axis in winit.
https://docs.rs/winit/latest/winit/event/enum.WindowEvent.html#variant.CursorMoved
(x,y) coords in pixels relative to the top-left corner of the window.
Because the range of this data is limited by the display area and it may
have been transformed by the OS to implement effects such as cursor
acceleration, it should not be used to implement non-cursor-like
interactions such as 3D camera control.
So we don't need y-axis flipping?
—
Reply to this email directly, view it on GitHub
<#2188 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGEJCEFF7OIY435XLVMONTWICD5RANCNFSM5NZDJQ4A>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I'm trying this PR in Bevy, and I had to flip back the Y axis in Bevy for it to work. |
I've tried the demo on my iPad and it works great! However, there are two problems I've encountered. First is that touch events using Apple Pencil don't register. Second is that canceled touch events, such as when switching windows when using four-finger swipes, aren't removed. The last one may be because the demo's source code doesn't handle canceled touch events. |
Apple Pencil emits pointer events with |
I'm finally confident that we don't need the y-flip, and it's ready to merge. Demo improvement (now it's really simple, comprehensive, and easy to understand)Changes are:
|
I can reproduce the issue with the demo on Chrome for Android, but it works fine everywhere else I could test it (Desktop Chromium, Firefox on Desktop and Android). Our |
I note the same on android but I too suspect it is not due to this pr. neet
to run an emulator or steal someone’s phone to check out what’s happening.
…On Thu, 1 Dec 2022 at 01:28, Markus Røyset ***@***.***> wrote:
I can reproduce the issue with the demo on Chrome for Android, but it
works fine *literally* everywhere else. Our web example also works fine
on Chrome for Android, so I wouldn't consider this to be a blocking issue.
—
Reply to this email directly, view it on GitHub
<#2188 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGEJCDYKICKF62OUX6KGY3WK75KXANCNFSM5NZDJQ4A>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
(My android issue was unrelated - was using a texture > 4096 high.)
…On Sun, 18 Dec 2022 at 18:25, peterhirn ***@***.***> wrote:
I was curious and fixed the android issue: demo
<https://peterhirn.github.io/winit-web-touch-event-test/>, repo
<https://github.com/peterhirn/winit-web-touch-event-test>. Everything
seems to work as expected. Nice work.
—
Reply to this email directly, view it on GitHub
<#2188 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGEJCCOJS3CHYPMZYDX4KTWN5JKHANCNFSM5NZDJQ4A>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry, I haven't really been following this issue, and am a bit confused - @ryo33, do you feel this is ready now?
I'd be fine with merging it as-is (once CI passes), it has gone for long enough and while it may not be perfect it's clearly an improvement :)
Co-authored-by: Mads Marquart <[email protected]>
@madsmtm Yes, I think it’s ready to merge. |
Cool, thanks for your contribution, and sorry again it took so long (it's difficult when we don't have a maintainer for web)! |
I haven’t figured winit out yet, but I hope I would be a maintainer for web in the future maybe. I’m creating a huge product that depends on winit, and it should work well on web. I may work on keyboard issues when my hands are free. |
CHANGELOG.md
if knowledge of this change could be valuable to usersCloses #1673
This PR is inherited from inactive PR #1945.
The differences are as follows:
and flipping the Y-axis.touch-action: none
to a canvas to prevent the browser from canceling pointer events.Source code of the demo is here