-
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
Implement touch handling on web target(s) #1673
Comments
I agree with your points on how to handle I think touch events from the browser should only generate touch events within winit. This is (I think?) consistent with other platforms, and allows the user to combine them if they want. |
It turns out the PEP polyfill doesn't work because it does not provide Still, I don't think it's really worth the effort to add |
Can anyone review #2188 ? |
Thanks for the review Liamolucko! |
Adding touch event handling shouldn't be too hard, but it is tightly coupled with mouse handling due to the web using a unified Pointer Event model. Here are my thoughts:
PointerEvent
is simple enough. However, I would be concerned about correctly mapping thepointerType
:"mouse"
- obviously should be mapped toCursorMove
,CursorEntered
,CursorLeft
andMouseInput
. In addition, I believe that only pointers withisPrimary === true
should be reported."touch"
- obviously should be mapped toTouch
."pen"
- this is tricky, aswinit
does not have an event for pen/stylus. I suggest that for now we just map pen input the same way as mouse input untilwinit
finally supports pen events properly.PointerEvent
- I suggest we do not add support forTouchEvent
, because:PointerEvent
is getting widespread support.Adding TouchEvent
handling will likely make the code quite complicated.If the user really care about supporting older browsers, they can use a JavaScript polyfill.Turns out the polyfill does not provideoffsetX
/offsetY
whichwinit
is currently using...The text was updated successfully, but these errors were encountered: