mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2025-01-17 14:47:19 +01:00
3a08b46336
Elise Maurer When inputting text, dead-keys are currently not handled correctly on Windows with the latest SDL2 tip as well as the 2.0.3 release. Using a French AZERTY keyboard, when I type the `^` key followed by `e` key to compose the `` character, I erroneously get two SDL_TEXTINPUT events, one with the `^` character and one with the `e` character. I've looked at the history for SDL_windowsevents.c and there's been some back-and-forth with several methods for handling text input: * r8142 removed any handling of WM_CHAR because keyboard input was being handled through WM_KEYDOWN along with ToUnicode since r7645. * But using ToUnicode actually breaks dead-keys (googling for "ToUnicode dead keys" reports many horror stories of people trying to work around that and failing). * It seems like r7645 introduced a double-fix: it fixed WM_CHAR to properly handle Unicode, and also (unnecessarily?) added text input handling to WM_KEYDOWN. Later, r8142 removed the WM_CHAR stuff instead of the WM_KEYDOWN stuff. The attached patch restores handling of text input through WM_CHAR and removes it from WM_KEYDOWN. I've tested it with French, English and Russian layouts and it seems to do its job. Obviously, with such matters, it's still a risky change. |
||
---|---|---|
.. | ||
SDL_msctf.h | ||
SDL_vkeys.h | ||
SDL_windowsclipboard.c | ||
SDL_windowsclipboard.h | ||
SDL_windowsevents.c | ||
SDL_windowsevents.h | ||
SDL_windowsframebuffer.c | ||
SDL_windowsframebuffer.h | ||
SDL_windowskeyboard.c | ||
SDL_windowskeyboard.h | ||
SDL_windowsmessagebox.c | ||
SDL_windowsmessagebox.h | ||
SDL_windowsmodes.c | ||
SDL_windowsmodes.h | ||
SDL_windowsmouse.c | ||
SDL_windowsmouse.h | ||
SDL_windowsopengl.c | ||
SDL_windowsopengl.h | ||
SDL_windowsopengles.c | ||
SDL_windowsopengles.h | ||
SDL_windowsshape.c | ||
SDL_windowsshape.h | ||
SDL_windowsvideo.c | ||
SDL_windowsvideo.h | ||
SDL_windowswindow.c | ||
SDL_windowswindow.h | ||
wmmsg.h |