Hi, m.hag... ;)
Just to say that I am with you and would love to have support of these also.
As maybe a small step I wrote recently a slightly more complete library 
<http://package.elm-lang.org/packages/mpizenberg/elm-touch-events/latest> 
handling also multitouch events, not only single touches.
You can retrieve clientX and clientY of all touches in the attributes 
touches, targetTouches and changedTouches. This could (theoretically) allow 
to process the touches and recognize some gestures, but thats not marginal 
work ...
Unfortunately, it does not support gesture yet, and don't know if I plan to 
work on this (not so much time these days).

On Friday, November 11, 2016 at 5:32:08 AM UTC+8, [email protected] wrote:
>
> Is there a recommended way to support gestures in Elm? In Javascript there 
> are nice libraries (HammerJS for example) that offer high level gesture 
> primitives. I'm relatively new to Elm but as far as I can tell:
>
> (a) There are no higher level touch/gesture libraries written natively in 
> Elm (the `Touch` package was discontinued in 0.17 (quite alarming if you 
> care about gestures), https://github.com/knledg/touch-events is just a 
> super thin wrapper around touch event listeners).
>
> (b) There isn't a clean way to "fall back to JS" in the case of touch 
> libraries because these libraries' APIs involve attaching directly to DOM 
> nodes. This causes problems because the virtual DOM is pure (and opaque). 
> In particular it doesn't have an equivalent to the "mount"/"unmount" 
> lifecycle events from React so you can't pass DOM nodes out to JS.
>
> I'd be super interested to hear about any practical experience with this 
> in a production environment. It seems like a problem that anyone writing 
> production applications for mobile must have encountered but I haven't been 
> able to find a solution.
>
> I absolutely love Elm compared to JS but the lack of high level gesture 
> primitives makes it impossible to use if you plan on having non-trivial 
> support for mobile (unless you want to write your own gesture support in 
> Elm).
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to