mpizenberg/elm-touch-events/1.0.0

NOTE: this package is not compatible with Elm 0.19.1

MultiTouch

This module exposes types and functions to deal with multitouch interactions.

type alias MultiTouch =
{ touchType : TouchEvent
, touches : Dict Int Touch
, targetTouches : Dict Int Touch
, changedTouches : Dict Int Touch
}

Type alias for a multitouch event.

The properties touches, targetTouches and changedTouches are represented by dictionaries in which the keys are the unique Int identifier of the Touch interactions.

To have more info about these properties and how to use them, please refer to the [Mozilla documentation] (https://developer.mozilla.org/en-US/docs/Web/Events/touchstart)

onMultiTouch : TouchEvent -> Options -> (MultiTouch -> msg) -> Attribute msg

An multitouch event handler.

import Touch as T
import MultiTouch as MT

type Msg
  = MultiTouchMsg T.TouchEvent MT.MultiTouch

view model =
  H.div [ ST.onMultiTouch T.TouchStart T.preventAndStop <| MultiTouchMsg T.TouchStart ] []