mirror of
https://github.com/yawut/SDL.git
synced 2026-07-30 07:02:07 -05:00
Support for UTF-8 text input has been added.
This commit is contained in:
parent
b6c6b41bb5
commit
744dfa75a8
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user