| Summary: | SDL_SendKeyboardText skips '\r' and '\n' to be reported as text input. | ||
|---|---|---|---|
| Product: | SDL | Reporter: | ongamex <ongamex> |
| Component: | events | Assignee: | Sam Lantinga <slouken> |
| Status: | NEW --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | amaranth72 |
| Version: | 2.0.10 | ||
| Hardware: | x86 | ||
| OS: | Windows 10 | ||
Can your code use SDL_KEYDOWN events for those? That approach has worked well for me in the past. |
SDL_SendKeyboardText skips '\r' and '\n' to be reported as text input. This happens because: int SDL_SendKeyboardText(const char *text) { // .... /* Don't post text events for unprintable characters */ if ((unsigned char)*text < ' ' || *text == 127) { // <---- HERE return 0; } The comment however doesn't describe why we need to do that. Is is because of some specific platform now reporting it? WINAPI reports these with WM_CHAR. I need those events as I'm writing a text editor and I need these in text in some form. Is there a workaround? Can this if be removed or better documented?