Skip to content
This repository was archived by the owner on Jan 17, 2020. It is now read-only.

Add a subscription to SDL.Event.TextInputEvent#135

Open
geezee wants to merge 1 commit into
z0w0:masterfrom
geezee:master
Open

Add a subscription to SDL.Event.TextInputEvent#135
geezee wants to merge 1 commit into
z0w0:masterfrom
geezee:master

Conversation

@geezee
Copy link
Copy Markdown

@geezee geezee commented Aug 19, 2018

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)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant