Not many changes, you should get through without any major issue. Most importantly:
- Mouse module is now under
Html.Events.Extra.Mouse
so changing your imports fromimport Mouse
toimport Html.Events.Extra.Mouse as Mouse
should be sufficient most of the time. - The
Mouse.Event
type now also hasbutton
,pagePos
andscreenPos
attributes. Depending on your usage, it might imply no or minor changes.
Many changes. Most importantly:
- The
Touch
module is now underHtml.Events.Extra.Touch
. You can change imports like so:import Html.Events.Extra.Touch as Touch
. - The modules
Touch
,SingleTouch
andMultiTouch
have been merged in one uniqueTouch
module. 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.Event
is not opaque anymore. - Touches (changed, target, touches) are simple list instead of dicts now.
Previous dict id are now in the
identifier : Int
field of aTouch
. - A
Touch
also 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 )