The is a library to provide touch event helpers
Supported touch directions
Type alias for the touch record on the touch event object
Returns a Touch record with 0 as default values
Gets the direction of the swipe on the x axis (Left or Right)
Higher level touch event handler
This takes a TouchEvent type and application Msg type.
The Msg type should take a TouchEvent.Touch type.
type Msg
= UserSwipeStart TouchEvents.Touch
view model =
div
[ TouchEvents.onTouchEvent TouchEvents.TouchStart UserSwipeStart
]
[]Lower level "touchend" event handler
Takes the application Msg type which should take TouchEvents.Touch
as a payload
type Msg
= UserSwipeEnd TouchEvents.Touch
view model =
div
[ TouchEvents.onTouchEnd UserSwipeEnd
]
[]Lower level "touchstart" event handler
Takes the application Msg type which should take TouchEvents.Touch
as a payload
type Msg
= UserSwipeStart TouchEvents.Touch
view model =
div
[ TouchEvents.onTouchStart UserSwipeStart
]
[]
Supported touch event types