-
Notifications
You must be signed in to change notification settings - Fork 6
/
MouseSignals3.elm
32 lines (26 loc) · 912 Bytes
/
MouseSignals3.elm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
module MouseSignals3 where
import Graphics.Element exposing (down, flow, leftAligned)
import List exposing (map)
import Mouse
import Signal exposing ((~), (<~), sampleOn)
import Text exposing (fromString)
showsignals a b c d e f g =
flow down <|
map (fromString >> leftAligned) [
"Mouse.position: " ++ toString a,
"Mouse.x: " ++ toString b,
"Mouse.y: " ++ toString c,
"Mouse.clicks: " ++ toString d,
"Mouse.isDown: " ++ toString e,
"sampleOn Mouse.clicks Mouse.position: " ++ toString f,
"sampleOn Mouse.isDown Mouse.position: " ++ toString g
]
main =
showsignals
<~ Mouse.position
~ Mouse.x
~ Mouse.y
~ Mouse.clicks
~ Mouse.isDown
~ sampleOn Mouse.clicks Mouse.position
~ sampleOn Mouse.isDown Mouse.position