src/video/x11/SDL_x11events.c
changeset 2300 c97ad1abe05b
parent 2299 a7cbc25071b6
child 2305 fbe8ff44c519
     1.1 --- a/src/video/x11/SDL_x11events.c	Sat Jan 12 18:07:06 2008 +0000
     1.2 +++ b/src/video/x11/SDL_x11events.c	Tue Jan 15 22:37:17 2008 +0000
     1.3 @@ -167,6 +167,9 @@
     1.4          /* Key press? */
     1.5      case KeyPress:{
     1.6              KeyCode keycode = xevent.xkey.keycode;
     1.7 +            KeySym keysym = NoSymbol;
     1.8 +            char text[sizeof(SDL_TEXTINPUTEVENT_TEXT_SIZE)];
     1.9 +            Uint32 ucs4 = 0;
    1.10  
    1.11  #ifdef DEBUG_XEVENTS
    1.12              printf("KeyPress (X11 keycode = 0x%X)\n", xevent.xkey.keycode);
    1.13 @@ -183,6 +186,13 @@
    1.14                                                          keycode, 0));
    1.15              }
    1.16  #endif
    1.17 +            /* works for Latin-1 */
    1.18 +            SDL_memset(&text[0], 0, SDL_TEXTINPUTEVENT_TEXT_SIZE);
    1.19 +            /* Xutf8LookupString() */
    1.20 +            XLookupString(&xevent, text, sizeof(text), &keysym, NULL);
    1.21 +            if (0 != SDL_strlen(text)) {
    1.22 +                SDL_SendKeyboardText(videodata->keyboard, text);
    1.23 +            }
    1.24          }
    1.25          break;
    1.26