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

Regression: key events not triggered when an IME language is active #9215

Open
expikr opened this issue Mar 6, 2024 · 6 comments
Open

Regression: key events not triggered when an IME language is active #9215

expikr opened this issue Mar 6, 2024 · 6 comments
Assignees
Milestone

Comments

@expikr
Copy link
Contributor

expikr commented Mar 6, 2024

See love2d/love#2031 (comment)

@slouken
Copy link
Collaborator

slouken commented Jun 25, 2024

I'm not sure this is a bug. The correct behavior on all platforms is that when the IME is composing the keystrokes are consumed by that process. It works this way on Windows and Linux, and is supposed to work that way on macOS but doesn't for technical reasons.

Can you give a specific example of what you expect to work and what behavior you're seeing?

@slouken slouken added the waiting Waiting on user response label Jun 29, 2024
@slouken slouken modified the milestones: 3.0 ABI, 3.2.0 Jun 29, 2024
@expikr
Copy link
Contributor Author

expikr commented Jun 29, 2024

I’m really not familiar with how IME is supposed to work in general, but my expectation of behaviour comes from that of a player of a game, in that I expect my character’s ability to move with WASD to not be influenced by the currently selected language. Whereas in say Minecraft (which uses glfw), if I accidentally switch to an IME language in the background, my inputs are simply locked with no indication as to why. This behaviour is also observed when you make a simple WASD-controlled game in Love2D.

@slime73 perhaps you might have a better idea of whether the responsibility rests with SDL or Love2D?

@slime73
Copy link
Contributor

slime73 commented Jun 29, 2024

if I accidentally switch to an IME language in the background, my inputs are simply locked with no indication as to why. This behaviour is also observed when you make a simple WASD-controlled game in Love2D.

This is only the case when you have text input enabled (so it starts generating textedited events instead of key press events), right? Which sounds like it's intentional behaviour from what Sam said, otherwise you might end up moving around ingame or activating menu options or shooting your friends or something unintentionally as you compose text.

@expikr
Copy link
Contributor Author

expikr commented Jun 29, 2024

So to clarify, the expectation is that the developer of the game must always remember to first disable textinput whenever they are in a character-controlling mode?

It seems like an easy mistake to not know about being expected to disable textinput, especially since even the likes of Minecraft doesn’t know to do this.

It probably makes more sense for Love2D or SDL to start off with textinput disabled by default and the developer only enable it on an as-needed basis.

In any case, regardless of whether or not the expectation is a reasonable design choice, I guess this means that this isn’t an issue on SDL’s part and is therefore not a library dependency issue for Love2D?

@slime73
Copy link
Contributor

slime73 commented Jun 29, 2024

love uses SDL's default state on a given platform (SDL2 has text input off by default on platforms where there's usually a virtual keyboard, like phones), however text input and key events are changing a fair amount in SDL3: https://github.com/libsdl-org/SDL/blob/main/docs/README-migration.md#sdl_keyboardh

@slouken
Copy link
Collaborator

slouken commented Jun 29, 2024

So to clarify, the expectation is that the developer of the game must always remember to first disable textinput whenever they are in a character-controlling mode?

It seems like an easy mistake to not know about being expected to disable textinput, especially since even the likes of Minecraft doesn’t know to do this.

It probably makes more sense for Love2D or SDL to start off with textinput disabled by default and the developer only enable it on an as-needed basis.

SDL3 starts with textinput disabled by default for exactly this reason.

@slouken slouken self-assigned this Oct 6, 2024
@slouken slouken removed the waiting Waiting on user response label Oct 6, 2024
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

No branches or pull requests

3 participants