This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
Simple multikey event handling library.
version 1.0.0
license MIT
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 1.0.0
Committed At 2017-06-20 08:41:58 UTC
elm-lang/html 2.0.0 <= v < 3.0.0 2.0.0
elm-lang/core 5.0.0 <= v < 6.0.0 5.1.1

README

elm-multikey-handling

Extra helpers for handling multiple key combinations on html nodes.

Usage

Just add the attribute to the html node

  div [ class "input-wrapper" ]
      [ input [ type_ "text"
              , id "new-item-input"
              , placeholder "Type item name"
              , onBlur (ItemInput Nothing)
              , onInput (\x -> ItemInput (Just x))
              , defaultKeyHandler
                  |> whenEnter (CreateItemClick boardName)
                  |> whenEscape (Iteam Nothing)
                  |> onKeydown
              ]
              [ text itemName ]

You can use whenKeydown when dealing with buttons without predefined decoders.

  defaultKeyHandler
    |> whenKeydown 13 (CreateItemClick boardName)
    |> onKeydown