elm/libraries/Mouse.elm

37 lines
709 B
Elm
Raw Normal View History

2013-02-21 22:43:32 +00:00
module Mouse where
{-| Library for working with mouse input.
# Position
@docs position, x, y
# Button Status
@docs isDown, clicks
-}
import Signal (Signal)
import Native.Mouse
{-| The current mouse position. -}
2013-02-21 22:43:32 +00:00
position : Signal (Int,Int)
position = Native.Mouse.position
2013-02-21 22:43:32 +00:00
{-| The current x-coordinate of the mouse. -}
2013-02-21 22:43:32 +00:00
x : Signal Int
x = Native.Mouse.x
2013-02-21 22:43:32 +00:00
{-| The current y-coordinate of the mouse. -}
2013-02-21 22:43:32 +00:00
y : Signal Int
y = Native.Mouse.y
2013-02-21 22:43:32 +00:00
{-| The current state of the left mouse-button.
True when the button is down, and false otherwise. -}
2013-02-21 22:43:32 +00:00
isDown : Signal Bool
isDown = Native.Mouse.isDown
2013-02-21 22:43:32 +00:00
{-| Always equal to unit. Event triggers on every mouse click. -}
2013-02-21 22:43:32 +00:00
clicks : Signal ()
clicks = Native.Mouse.clicks