Enable `SDL_TEXTEDITING_EXT` events in `checkkeys` test

This commit is contained in:
Susko3 2022-05-03 00:40:42 +02:00 committed by Sam Lantinga
parent 6150245d65
commit f25a78eede
1 changed files with 8 additions and 1 deletions

View File

@ -165,7 +165,11 @@ loop()
PrintKey(&event.key.keysym, (event.key.state == SDL_PRESSED) ? SDL_TRUE : SDL_FALSE, (event.key.repeat) ? SDL_TRUE : SDL_FALSE); PrintKey(&event.key.keysym, (event.key.state == SDL_PRESSED) ? SDL_TRUE : SDL_FALSE, (event.key.repeat) ? SDL_TRUE : SDL_FALSE);
break; break;
case SDL_TEXTEDITING: case SDL_TEXTEDITING:
PrintText("EDIT", event.text.text); PrintText("EDIT", event.edit.text);
break;
case SDL_TEXTEDITING_EXT:
PrintText("EDIT_EXT", event.editExt.text);
SDL_free(event.editExt.text);
break; break;
case SDL_TEXTINPUT: case SDL_TEXTINPUT:
PrintText("INPUT", event.text.text); PrintText("INPUT", event.text.text);
@ -207,6 +211,9 @@ main(int argc, char *argv[])
/* Enable standard application logging */ /* Enable standard application logging */
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
/* Enable extended text editing events */
SDL_SetHint(SDL_HINT_IME_SUPPORT_EXTENDED_TEXT, "1");
/* Initialize SDL */ /* Initialize SDL */
if (SDL_Init(SDL_INIT_VIDEO) < 0) { if (SDL_Init(SDL_INIT_VIDEO) < 0) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError());