HTML Event listeners for on 'keyup' and on 'keydown'. For each one of them, it stops propagation.
It will give you the ASCII code of the key being released- You can read a complete simple example in the README.
type Msg
KeyUp Int
view : Html Msg
view =
textarea
[ rows 10
, cols 40
, onKeyUp KeyUp
]
[]
]
update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
case msg of
KeyUp code ->
(model, Cmd.none)
It will give you the ASCII code of the key being pressed. Plus, it will tell you if the
shiftkey is pressed as well. You can read a complete simple example in the README.