3import Native.Keyboard as N
5-- Type alias to make it clearer what integers are supposed to represent
6-- in this library. Use [`Char.toCode`](docs/Char.elm#toCode) and
7-- [`Char.fromCode`](/docs/Char.elm#fromCode) to convert key codes to characters.
10-- A signal of records indicating which arrow keys are pressed.
12-- `{ x = 0, y = 0 }` when pressing no arrows.<br>
13-- `{ x =-1, y = 0 }` when pressing the left arrow.<br>
14-- `{ x = 1, y = 1 }` when pressing the up and right arrows.<br>
15-- `{ x = 0, y =-1 }` when pressing the down, left, and right arrows.
16arrows : Signal { x:Int, y:Int }
17arrows = N.directions 38 40 37 39
19-- Just like the arrows signal, but this uses keys w, a, s, and d,
20-- which are common controls for many computer games.
21wasd : Signal { x:Int, y:Int }
22wasd = N.directions 87 83 65 68
24-- Custom key directions so that you can support different locales.
25-- The plan is to have a locale independent version of this function
26-- that uses the physical location of keys, but I don't know how to do it.
27directions : KeyCode -> KeyCode -> KeyCode -> KeyCode -> Signal { x:Int, y:Int }
29-- Whether an arbitrary key is pressed.
30isDown : KeyCode -> Signal Bool
32-- Whether the shift key is pressed.
36-- Whether the control key is pressed.
40-- Whether the space key is pressed.
44-- Whether the enter key is pressed.
48-- List of keys that are currently down.
49keysDown : Signal [KeyCode]
51-- The latest key that has been pressed.
52lastPressed : Signal KeyCode
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list