Support for UTF-8 text input has been added.
authorMike Gorchak <lestat@i.com.ua>
Fri, 20 Nov 2009 14:42:40 +0000
changeset 3465 0cbfec87e4f1
parent 3464 09136f534198
child 3466 a288892cd24c
Support for UTF-8 text input has been added.
src/video/photon/SDL_photon.c
--- a/src/video/photon/SDL_photon.c	Fri Nov 20 07:11:29 2009 +0000
+++ b/src/video/photon/SDL_photon.c	Fri Nov 20 14:42:40 2009 +0000
@@ -2685,6 +2685,23 @@
                                 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;