Closed increpare closed 7 months ago
This popup is from the IME to allow you type accented letters that don't exist on the keyboard. It appears because SDL enables text input events by default. If you don't need the full IME capabilities (such as for typing a player name), calling SDL_StopTextInput()
disables this behavior.
Amazing, thanks. Okay, so this is the desired SDL default behaviour I guess, and better to be worked around in the individual engines that use it? Feel free to close if so. :)
Possibly relevant system setting: I have the "ABC - Extended" keyboard layout selected.
Code snippet reproducing the issue:
The lazyfoo tutorial project here https://lazyfoo.net/tutorials/SDL/01_hello_SDL/mac/index.php - just with an empty window I get the behaviour. (This bug has already percolated through HaxeFlixel and OpenFL )
Observed behavior:
If I hold down certain keys on the keyboard that have variants/accents (like the A key, for instance), then a menu will appear to the top-left of the window (if in windowed mode):
If I change the window instantiation to use SDL_WINDOW_FULLSCREEN_DESKTOP, then I get the menu appearing in the top-left of the screen:
If I use SDL_WINDOW_FULLSCREEN then I do not get this behaviour (I haven't checked if the input isn't maybe otherwise affected though).
Expected behavior:
Unless I'm specifically inputting into a text field, I would not want this menu to appear. And in those cases, were it to appear, I would want it to appear in the correct location. Asking for perfect behaviour might be too much, but I would much prefer the menu never appear, rather than its current behaviour.
This is present in Haxe games like Dead Cells, so there must be some similarities in window instantiation/app settings.
Screenshot of the behaviour occuring in HaxeFlixel 5.6.2:
Screenshot of the behaviour in Lime 8.2.0-Dev:
Looking for games/apps that don't exhibit this behaviour, in case it might be helpful - VVVVVV seems to use SDL2 (it contains libSDL2-2.0.0.dylib), but doesn't exhibit the behaviour.
Possible links to people possibly struggling with the same problem that I stumbled across while I was trying to solve it myself (sometimes it manifests as people reporting that key-repeats aren't getting sent):
https://apple.stackexchange.com/questions/332769/macos-disable-popup-showing-accented-characters-when-holding-down-a-key https://www.reddit.com/r/runescape/comments/atudk0/macbook_whenever_i_press_and_hold_a_key_an_accent/ https://github.com/bus-stop/Termination/issues/9 https://fsunuc.physics.fsu.edu/git/gwm17/glfw/commit/17a15a20f28ed95e0e69d403687416c023c77e7e https://stackoverflow.com/questions/76546729/why-are-certain-repeated-keys-ignored-by-interpretkeyevents-in-nsresponder https://fsunuc.physics.fsu.edu/git/gwm17/glfw/commit/17a15a20f28ed95e0e69d403687416c023c77e7e https://github.com/smolck/uivonim/issues/106#issuecomment-782522713