comparison src/video/photon/SDL_photon.c @ 3465:0cbfec87e4f1

Support for UTF-8 text input has been added.
author Mike Gorchak <lestat@i.com.ua>
date Fri, 20 Nov 2009 14:42:40 +0000
parents d15a4daa4a58
children 4b594623401b
comparison
equal deleted inserted replaced
3464:09136f534198 3465:0cbfec87e4f1
2683 if ((scancode == SDL_SCANCODE_PRINTSCREEN) 2683 if ((scancode == SDL_SCANCODE_PRINTSCREEN)
2684 && (pressed)) { 2684 && (pressed)) {
2685 SDL_SendKeyboardKey(0, SDL_RELEASED, 2685 SDL_SendKeyboardKey(0, SDL_RELEASED,
2686 scancode); 2686 scancode);
2687 } 2687 }
2688
2689 }
2690
2691 /* Handle UTF-8 text input if requested by caller */
2692 if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY))
2693 {
2694 char text[5];
2695
2696 SDL_memset(text, 0x00, 5);
2697 if (PhKeyToMb(text, keyevent)!=-1)
2698 {
2699 SDL_SendKeyboardText(0, text);
2700 }
2701 else
2702 {
2703 /* Just do nothing if it is not a UTF-8 character */
2704 }
2688 } 2705 }
2689 } 2706 }
2690 break; 2707 break;
2691 case Ph_EV_SERVICE: 2708 case Ph_EV_SERVICE:
2692 { 2709 {