elm-lang/keyboard/1.0.1

NOTE: this package is not compatible with Elm 0.19.1

Keyboard

This library lets you listen to global keyboard events.

Key Codes

type alias KeyCode =
Int

Keyboard keys can be represented as integers. These are called key codes. You can use toCode and fromCode to convert between key codes and characters.

Subscriptions

presses : (KeyCode -> msg) -> Sub msg

Subscribe to all key presses.

downs : (KeyCode -> msg) -> Sub msg

Subscribe to get codes whenever a key goes down.

ups : (KeyCode -> msg) -> Sub msg

Subscribe to get codes whenever a key goes up.