https://github.com/billstclair/elm-keyboard-example
An example of the elm-lang/keyboard package
https://github.com/billstclair/elm-keyboard-example
Last synced: over 1 year ago
JSON representation
An example of the elm-lang/keyboard package
- Host: GitHub
- URL: https://github.com/billstclair/elm-keyboard-example
- Owner: billstclair
- License: mit
- Created: 2016-10-17T11:02:23.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-17T12:15:17.000Z (over 9 years ago)
- Last Synced: 2025-03-02T19:43:05.079Z (over 1 year ago)
- Language: Elm
- Size: 8.79 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
A simple test for the ```elm-lang/keyboard``` package.
To run it:
```
cd .../elm-keyboard-example
elm reactor
```
Then aim your browser at [localhost:8000/keyboard-test.elm](http://localhost:8000/keyboard-test.elm), and press keys on your keyboard to see them displayed on the page, and their keycodes displayed in your browser's developer tools debugging console.
To include the ```elm-lang/keyboard``` package in your own project:
```
cd .../path/to/your/project/directory
elm package install elm-lang/keyboard
```
```elm-lang/keyboard``` is documented [here](http://package.elm-lang.org/packages/elm-lang/keyboard/latest).
I built an HTML file with:
```
elm make keyboard-test.elm --output elm-keyboard-example.html
```
And uploaded that to [lisplog.org/elm-keyboard-example.html](https://lisplog.org/elm-keyboard-example.html).
The source code is at [github.com/billstclair/elm-keyboard-example](https://github.com/billstclair/elm-keyboard-example).
This example illustrates the problems documented at [github.com/elm-lang/keyboard/issues/3](https://github.com/elm-lang/keyboard/issues/3): "Not all key codes work in every browser."