Open expikr opened 8 months ago
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?
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?
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.
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?
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
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.
See https://github.com/love2d/love/issues/2031#issuecomment-1981952827