on master help sign in
Get Mouse compiling
e1d26d0Evan Czaplicki
libraries/Mouse.elm+7−1
@@ -1,24 +1,30 @@
1
1
2module Mouse where
2module Mouse where
3
3
4−import Native.Mouse as M
4+import Native.Mouse as Native
5
5
6-- The current mouse position.
6-- The current mouse position.
7position : Signal (Int,Int)
7position : Signal (Int,Int)
8+position = Native.position
8
9
9-- The current x-coordinate of the mouse.
10-- The current x-coordinate of the mouse.
10x : Signal Int
11x : Signal Int
12+x = Native.x
11
13
12-- The current y-coordinate of the mouse.
14-- The current y-coordinate of the mouse.
13y : Signal Int
15y : Signal Int
16+y = Native.y
14
17
15-- The current state of the left mouse-button.
18-- The current state of the left mouse-button.
16-- True when the button is down, and false otherwise.
19-- True when the button is down, and false otherwise.
17isDown : Signal Bool
20isDown : Signal Bool
21+isDown = Native.isDown
18
22
19-- True immediately after the left mouse-button has been clicked,
23-- True immediately after the left mouse-button has been clicked,
20-- and false otherwise.
24-- and false otherwise.
21isClicked : Signal Bool
25isClicked : Signal Bool
26+isClicked = Native.isClicked
22
27
23-- Always equal to unit. Event triggers on every mouse click.
28-- Always equal to unit. Event triggers on every mouse click.
24clicks : Signal ()
29clicks : Signal ()
30+clicks = Native.clicks