In my Elm program I would like to have some keyboard shortcuts. Now I have a shortcut 'd' who does what I want but I want the key combination to be alt+d.
StartApp.start {
init = (emptyModel, Effects.none),
view = view,
update = update,
inputs = [ Signal.map forwardKey Keyboard.presses]
}
forwardKey : Int -> Action
forwardKey keyCode =
case (Char.fromCode keyCode) of
'd' -> Add
_ -> NoOp
I noticed that their is a keyboard.alt signal that return Signal Bool to check if alt is pressed or not.
I have not succeeded to let the combination work.
I'm new at Elm so any explanation is welcome.. Thanks a lot!