mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-20 22:16:49 +01:00
Windows: Fixed ignoring return value of internal function.
If the function WIN_ConvertUTF32toUTF8() failed (should currently not be possible) a not terminated string would have been sent as text input event. This also fixed converting characters more often than needed on key repetition.
This commit is contained in:
parent
8f4c2a8f9c
commit
060d243f66
@ -559,13 +559,14 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
GetKeyboardState(keyboardState);
|
GetKeyboardState(keyboardState);
|
||||||
if (ToUnicode(wParam, (lParam >> 16) & 0xff, keyboardState, (LPWSTR)&utf32, 1, 0) > 0) {
|
if (ToUnicode(wParam, (lParam >> 16) & 0xff, keyboardState, (LPWSTR)&utf32, 1, 0) > 0) {
|
||||||
|
if (WIN_ConvertUTF32toUTF8(utf32, text)) {
|
||||||
WORD repetition;
|
WORD repetition;
|
||||||
for (repetition = lParam & 0xffff; repetition > 0; repetition--) {
|
for (repetition = lParam & 0xffff; repetition > 0; repetition--) {
|
||||||
WIN_ConvertUTF32toUTF8(utf32, text);
|
|
||||||
SDL_SendKeyboardText(text);
|
SDL_SendKeyboardText(text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
returnCode = 0;
|
returnCode = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user