Support for UTF-8 text input has been added.

This commit is contained in:
Mike Gorchak 2009-11-20 14:42:40 +00:00
parent b6c6b41bb5
commit 744dfa75a8

View File

@ -2685,6 +2685,23 @@ photon_pumpevents(_THIS)
SDL_SendKeyboardKey(0, SDL_RELEASED,
scancode);
}
}
/* Handle UTF-8 text input if requested by caller */
if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY))
{
char text[5];
SDL_memset(text, 0x00, 5);
if (PhKeyToMb(text, keyevent)!=-1)
{
SDL_SendKeyboardText(0, text);
}
else
{
/* Just do nothing if it is not a UTF-8 character */
}
}
}
break;