elm/libraries/Mouse.elm

31 lines
723 B
Elm
Raw Normal View History

2013-02-21 22:43:32 +00:00
module Mouse where
import Signal (Signal)
import Native.Mouse
2013-02-21 22:43:32 +00:00
-- The current mouse position.
position : Signal (Int,Int)
position = Native.Mouse.position
2013-02-21 22:43:32 +00:00
-- The current x-coordinate of the mouse.
x : Signal Int
x = Native.Mouse.x
2013-02-21 22:43:32 +00:00
-- The current y-coordinate of the mouse.
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.
isDown : Signal Bool
isDown = Native.Mouse.isDown
2013-02-21 22:43:32 +00:00
-- True immediately after the left mouse-button has been clicked,
-- and false otherwise.
isClicked : Signal Bool
isClicked = Native.Mouse.isClicked
2013-02-21 22:43:32 +00:00
-- Always equal to unit. Event triggers on every mouse click.
clicks : Signal ()
clicks = Native.Mouse.clicks