Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don’t remove last char when deadkey is pressed. #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Nuclear-Squid
Copy link
Contributor

As I stated in #29, dead keys remove the last character of the input field. I included a gif bellow to show how to reproduce the bug (just type something, then input a dead key other than 1dk).

output

This is because when a deadkey is pressed, the event listner in demo.js is called twice in quick succession. It’s supposed to be called once, to delete the key hint the browser automatically writes (since x-keyboard gives way better hints), but the extra call also deletes another character.

Logging those events (see gif, on the right hand side) shows they are basically the same, except the first event has the isComposing field set to true and the second one to false.

Removing the last char only when event.isComposing is set to true fixes that problem, and seems to be the only event we care about, if I understand MDN’s documentation correctly, though there may be an edge case I don’t know about (god knows JS has a lot of those…).

@fabi1cazenave
Copy link
Collaborator

This is really peculiar. I can’t reproduce the bug you’ve explained with so much detail, and your patch introduces a regression on my side — with Ergo-L 0.99.2, pressing 1dk inputs an o in my input area. However, your screencast leaves no doubt about the bug…

Wild guess : this happens because you already type in Ergo-L in the Ergo-L emulation input, and I’m using Lafayette.

So we do have an issue here, but we need to nail it very precisely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants