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

Defold adds a space after typing " when using a keyboard layout with dead keys on Windows 10/11 #8921

Open
f2l2pe opened this issue May 14, 2024 · 1 comment
Labels
bug Something is not working as expected editor Issues related to the Defold editor javafx Issue related to JavaFX in the editor text-editor An issue related to the text/code editor windows Issue related to the Windows platform

Comments

@f2l2pe
Copy link

f2l2pe commented May 14, 2024

Describe the bug (REQUIRED)
When typing any kind of dead key on a keyboard layout that supports it (e.g.", ') if you press space after typing one character, it adds a space after adding the character. The correct behaviour should be just to add the character.

To Reproduce (REQUIRED)
Steps to reproduce the behavior:

  1. Have Windows installed
  2. Use a keyboard layout that supports dead keys (in my case it is ENGLISH INTERNATIONAL)
  3. Try to type any dead key, like double quotes, for example, and press space
  4. See an extra space being added

Expected behavior (REQUIRED)
It should not add the extra space

Right now, this happens: "
What should happen is: "

Defold version (REQUIRED):

  • Version 1.8.0

Platforms (REQUIRED):

  • Platforms: N/A
  • OS: Windows
  • Device: N/A

Screenshots:

editor.mp4
@f2l2pe f2l2pe added the bug Something is not working as expected label May 14, 2024
@britzl britzl added windows Issue related to the Windows platform editor Issues related to the Defold editor labels May 20, 2024
@matgis matgis added the text-editor An issue related to the text/code editor label May 20, 2024
@matgis
Copy link
Contributor

matgis commented May 20, 2024

This looks like it might be related to the following issue in JavaFX, which we use for the editor UI:
https://bugs.openjdk.org/browse/JDK-8183521

Although a comment on that issue suggests there might be something strange about how Windows itself reports the key events.

Because various keyboard layouts can specify different keys as "dead keys", we rely on the underlying UI infrastructure to correctly report the key events. We do however have a workaround in place to deal with a similar situation for the tilde ~ key, which is a "dead key" in the Swedish keyboard layout. Currently we get an umlaut ¨ character immediately following the tilde character on Windows, and we simply throw away any umlaut immediately following a tilde. We could probably extend this workaround to cover other "dead keys", but for obvious reasons we can't throw away a space that immediately follows a quote character.

What we could probably do, is discard certain characters that immediately follow a dead key within a very short timespan, but unfortunately we cannot tell if a character is a dead key or not based on the incoming key event. But maybe it would be enough to treat any two key events that occur within a non-typable timespan as a "dead key" input? 🤔

@matgis matgis added the javafx Issue related to JavaFX in the editor label May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working as expected editor Issues related to the Defold editor javafx Issue related to JavaFX in the editor text-editor An issue related to the text/code editor windows Issue related to the Windows platform
Projects
None yet
Development

No branches or pull requests

3 participants