elm-lang / keyboard

Global keyboard events in Elm

Home Page:http://package.elm-lang.org/packages/elm-lang/keyboard/latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No access to modifier states

wehlutyk opened this issue · comments

Problem

I have a project that uses Ctrl+Enter for control. Tracking this in pure Elm requires keeping track of which keys are up or down à la ohanhi/keyboard-extra. But this method is error-prone as it runs into the problem described here in #1: if Ctrl is down, and the browser is not focused at the moment Ctrl goes up, the tracked state in Elm is still "down" (ohanhi/keyboard-extra only tracks ups and downs, not window blurs).

I guess giving access to modifier states isn't hard, but as suggested in the Readme I'll leave potential solutions out of the report :)

In the interim, there are things in http://package.elm-lang.org/packages/Gizra/elm-keyboard-event/latest which you might find helpful.