mpizenberg/elm-mouse-events/2.0.0

NOTE: this package is not compatible with Elm 0.19.1

Mouse

Handling detailed mouse events.

type alias Event =
{ key : Keys
, clientPos : Coordinates
, offsetPos : Coordinates
}

Type that get returned by a mouse event.

type alias Keys =
{ alt : Bool
, ctrl : Bool
, shift : Bool
}

The keys that might have been pressed during mouse event.

type alias Coordinates =
( Float, Float )

Coordinates of a mouse event.

onDown : (Event -> msg) -> Attribute msg

Listen to mousedown events.

onMove : (Event -> msg) -> Attribute msg

Listen to mousemove events.

onUp : (Event -> msg) -> Attribute msg

Listen to mouseup events.

onWithOptions : String -> Options -> (Event -> msg) -> Attribute msg

Choose the mouse event to listen to, and specify the event options.

eventDecoder : Decoder Event

An Event decoder for mouse events.