on 4bec310 help sign in
elk/libraries/Mouse.elm
36 lines 709 B history raw
2module Mouse where
4{-| Library for working with mouse input.
6# Position
7@docs position, x, y
9# Button Status
10@docs isDown, clicks
12-}
14import Signal (Signal)
15import Native.Mouse
17{-| The current mouse position. -}
18position : Signal (Int,Int)
19position = Native.Mouse.position
21{-| The current x-coordinate of the mouse. -}
22x : Signal Int
23x = Native.Mouse.x
25{-| The current y-coordinate of the mouse. -}
26y : Signal Int
27y = Native.Mouse.y
29{-| The current state of the left mouse-button.
30True when the button is down, and false otherwise. -}
31isDown : Signal Bool
32isDown = Native.Mouse.isDown
34{-| Always equal to unit. Event triggers on every mouse click. -}
35clicks : Signal ()
36clicks = Native.Mouse.clicks