Not many changes, you should get through without any major issue. Most importantly:
- Mouse module is now under
Html.Events.Extra.Mouseso changing your imports fromimport Mousetoimport Html.Events.Extra.Mouse as Mouseshould be sufficient most of the time. - The
Mouse.Eventtype now also hasbutton,pagePosandscreenPosattributes. Depending on your usage, it might imply no or minor changes.
Many changes. Most importantly:
- The
Touchmodule is now underHtml.Events.Extra.Touch. You can change imports like so:import Html.Events.Extra.Touch as Touch. - The modules
Touch,SingleTouchandMultiTouchhave been merged in one uniqueTouchmodule. It only features multitouch since getting a single touch event from the multitouch event is trivial with a function liketouchCoordinates(see below). - The type
Touch.Eventis not opaque anymore. - Touches (changed, target, touches) are simple list instead of dicts now.
Previous dict id are now in the
identifier : Intfield of aTouch. - A
Touchalso provides page and screen positions in addition to client. - Decoders are provided for advanced usage in case needed.
touchCoordinates : Touch.Event -> ( Float, Float )
touchCoordinates touchEvent =
List.head touchEvent.changedTouches
|> Maybe.map .clientPos
|> Maybe.withDefault ( 0, 0 )