Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Added arrow key handler
Browse files Browse the repository at this point in the history
  • Loading branch information
oldfartdeveloper committed Jun 14, 2016
1 parent ed83af3 commit ae350ec
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Key.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module Key exposing (..)


type Key
= ArrowLeft
| ArrowUp
| ArrowRight
| ArrowDown
| Unknown


fromCode : Int -> Key
fromCode keyCode =
case keyCode of
37 ->
ArrowLeft

38 ->
ArrowUp

39 ->
ArrowRight

40 ->
ArrowDown

_ ->
Unknown

0 comments on commit ae350ec

Please sign in to comment.