| Summary: | Duplicate SDL_TEXTINPUT events for a single key on Windows | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Amanieu d'Antras <amanieu> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED ABANDONED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | bugzilla-sdl |
| Version: | 2.0.1 | ||
| Hardware: | x86_64 | ||
| OS: | Windows 7 | ||
| See Also: |
https://bugzilla.libsdl.org/show_bug.cgi?id=2406 https://bugzilla.libsdl.org/show_bug.cgi?id=1876 |
||
|
Description
Amanieu d'Antras
2013-12-07 22:34:43 UTC
A real keystroke always only generates a WM_KEYDOWN event. An optional WM_CHAR event is generated either by applications sending it directly or is generated by the call of TranslateMessage(&msg) which was removed by this patch because it is passing the correct keystrokes directly using SDL_SendKeyboardText(). TranslateMessage() does not produce correct information when the languages do not have an ASCII-compatible character set. SDL_dxjoystick.c uses TranslateMessage() as well but I cannot quite see a reason as to why. Could that have been the real source of your problem? https://hg.libsdl.org/SDL/rev/061ee02876e3 / https://hg.libsdl.org/SDL/rev/ce90b743882a have likely "solved" your problem by just ignoring WM_CHAR as well as WM_UNICHAR events sent to the application entirely which unfortunately was bad idea as well. I would be very curious to know what exactly was going on in your case - do you have more information you could provide? In my case I had a non-SDL window (pdcurses win32a) open in the same thread as an SDL window. This caused various issues, most noticeably this double input bug. I have worked around this by moving the non-SDL window into a separate thread. Could it be that your non-SDL window did the TranslateMessage()-step itself and then passed both events along to the SDL message handler? I suppose to prevent such a case we could store the low word of a message field http://msdn.microsoft.com/en-us/library/windows/desktop/ms644958%28v=vs.85%29.aspx to prevent that we don't process the same message twice, but I'm unsure if that would be acceptable behavior. A bunch of the Windows input handling has been rewritten. Are you still getting this in the latest SDL snapshot? http://www.libsdl.org/tmp/SDL-2.0.zip Thanks! Hello, and sorry if you're getting dozens of copies of this message by email. We are closing out bugs that appear to be abandoned in some form. This can happen for lots of reasons: we couldn't reproduce it, conversation faded out, the bug was noted as fixed in a comment but we forgot to mark it resolved, the report is good but the fix is impractical, we fixed it a long time ago without realizing there was an associated report, etc. Individually, any of these bugs might have a better resolution (such as WONTFIX or WORKSFORME or INVALID) but we've added a new resolution of ABANDONED to make this easily searchable and make it clear that it's not necessarily unreasonable to revive a given bug report. So if this bug is still a going concern and you feel it should still be open: please feel free to reopen it! But unless you respond, we'd like to consider these bugs closed, as many of them are several years old and overwhelming our ability to prioritize recent issues. (please note that hundred of bug reports were sorted through here, so we apologize for any human error. Just reopen the bug in that case!) Thanks, --ryan. |