@@ -8,7 +8,10 @@ module Keyboard where
8@docs arrows, wasd, directions
8@docs arrows, wasd, directions
10# Specific Keys
10# Specific Keys
11+The following signals are `True` when the particular key is pressed and `False`
11−@docs shift, enter, space, ctrl
14+@docs enter, space, ctrl, shift, alt, meta
13# General Keypresses
16# General Keypresses
14@docs isDown, keysDown, lastPressed
17@docs isDown, keysDown, lastPressed
@@ -50,19 +53,23 @@ wasd = directions 87 83 65 68
50isDown : KeyCode -> Signal Bool
53isDown : KeyCode -> Signal Bool
51isDown = Native.Keyboard.isDown
54isDown = Native.Keyboard.isDown
53−{-| Whether the shift key is pressed. -}
56+alt : Signal Bool
57+alt = Native.Keyboard.alt
62+{-| The meta key is the Windows key on Windows and the Command key on Mac.
65+meta = Native.Keyboard.meta
54shift : Signal Bool
67shift : Signal Bool
55shift = isDown 16
68shift = isDown 16
57−{-| Whether the control key is pressed. -}
61−{-| Whether the space key is pressed. -}
62space : Signal Bool
70space : Signal Bool
63space = isDown 32
71space = isDown 32
65−{-| Whether the enter key is pressed. -}
66enter : Signal Bool
73enter : Signal Bool
67enter = isDown 13
74enter = isDown 13