helm
helm copied to clipboard
Add a subscription to SDL.Event.TextInputEvent
I'm working on a keyboard that is not the US standard layout (QWERTZ) for example SHIFT+4 is not $. So I cannot detect keys beyond the ones in Helm.Keyboard, and that's a serious limitation to what I'm developing.
Therefore I propose this patch that exposes a subscription Helm.Keyboard.typing :: Engine e => (Data.Text.Text -> a) -> Sub e a
which gets called whenever a key (or key combination) gets pressed with the argument being the resulting character. For example pressing shift and x would traditionally call twice Helm.Keyboard.ups
, with this patch it will also call Helm.Keyboard.typing
once with the text being X.
I also modified the helm-example-hello executable to demo this subscription. You can find the code on the branch example-textinputevent
of my fork (or directly here)