@@ -64,9 +64,9 @@ static SDL_Scancode oskeymap[256];
6464
6565
6666static SDL_Keysym * DirectFB_TranslateKey (_THIS , DFBWindowEvent * evt ,
67- SDL_Keysym * keysym );
67+ SDL_Keysym * keysym , Uint32 * unicode );
6868static SDL_Keysym * DirectFB_TranslateKeyInputEvent (_THIS , DFBInputEvent * evt ,
69- SDL_Keysym * keysym );
69+ SDL_Keysym * keysym , Uint32 * unicode );
7070
7171static void DirectFB_InitOSKeymap (_THIS , SDL_Scancode * keypmap , int numkeys );
7272static int DirectFB_TranslateButton (DFBInputDeviceButtonIdentifier button );
@@ -176,6 +176,7 @@ ProcessWindowEvent(_THIS, SDL_Window *sdlwin, DFBWindowEvent * evt)
176176 SDL_DFB_DEVICEDATA (_this );
177177 SDL_DFB_WINDOWDATA (sdlwin );
178178 SDL_Keysym keysym ;
179+ Uint32 unicode ;
179180 char text [SDL_TEXTINPUTEVENT_TEXT_SIZE ];
180181
181182 if (evt -> clazz == DFEC_WINDOW ) {
@@ -231,12 +232,12 @@ ProcessWindowEvent(_THIS, SDL_Window *sdlwin, DFBWindowEvent * evt)
231232 break ;
232233 case DWET_KEYDOWN :
233234 if (!devdata -> use_linux_input ) {
234- DirectFB_TranslateKey (_this , evt , & keysym );
235+ DirectFB_TranslateKey (_this , evt , & keysym , & unicode );
235236 /*printf("Scancode %d %d %d\n", keysym.scancode, evt->key_code, evt->key_id);*/
236237 SDL_SendKeyboardKey_ex (0 , SDL_PRESSED , keysym .scancode );
237238 if (SDL_EventState (SDL_TEXTINPUT , SDL_QUERY )) {
238239 SDL_zero (text );
239- UnicodeToUtf8 (keysym . unicode , text );
240+ UnicodeToUtf8 (unicode , text );
240241 if (* text ) {
241242 SDL_SendKeyboardText_ex (0 , text );
242243 }
@@ -245,7 +246,7 @@ ProcessWindowEvent(_THIS, SDL_Window *sdlwin, DFBWindowEvent * evt)
245246 break ;
246247 case DWET_KEYUP :
247248 if (!devdata -> use_linux_input ) {
248- DirectFB_TranslateKey (_this , evt , & keysym );
249+ DirectFB_TranslateKey (_this , evt , & keysym , & unicode );
249250 SDL_SendKeyboardKey_ex (0 , SDL_RELEASED , keysym .scancode );
250251 }
251252 break ;
@@ -309,6 +310,7 @@ ProcessInputEvent(_THIS, DFBInputEvent * ievt)
309310 SDL_DFB_DEVICEDATA (_this );
310311 SDL_Keysym keysym ;
311312 int kbd_idx ;
313+ Uint32 unicode ;
312314 char text [SDL_TEXTINPUTEVENT_TEXT_SIZE ];
313315
314316 if (!devdata -> use_linux_input ) {
@@ -366,20 +368,20 @@ ProcessInputEvent(_THIS, DFBInputEvent * ievt)
366368 break ;
367369 case DIET_KEYPRESS :
368370 kbd_idx = KbdIndex (_this , ievt -> device_id );
369- DirectFB_TranslateKeyInputEvent (_this , ievt , & keysym );
371+ DirectFB_TranslateKeyInputEvent (_this , ievt , & keysym , & unicode );
370372 /*printf("Scancode %d %d %d\n", keysym.scancode, evt->key_code, evt->key_id); */
371373 SDL_SendKeyboardKey_ex (kbd_idx , SDL_PRESSED , keysym .scancode );
372374 if (SDL_EventState (SDL_TEXTINPUT , SDL_QUERY )) {
373375 SDL_zero (text );
374- UnicodeToUtf8 (keysym . unicode , text );
376+ UnicodeToUtf8 (unicode , text );
375377 if (* text ) {
376378 SDL_SendKeyboardText_ex (kbd_idx , text );
377379 }
378380 }
379381 break ;
380382 case DIET_KEYRELEASE :
381383 kbd_idx = KbdIndex (_this , ievt -> device_id );
382- DirectFB_TranslateKeyInputEvent (_this , ievt , & keysym );
384+ DirectFB_TranslateKeyInputEvent (_this , ievt , & keysym , & unicode );
383385 SDL_SendKeyboardKey_ex (kbd_idx , SDL_RELEASED , keysym .scancode );
384386 break ;
385387 case DIET_BUTTONPRESS :
@@ -575,7 +577,7 @@ DirectFB_InitOSKeymap(_THIS, SDL_Scancode * keymap, int numkeys)
575577}
576578
577579static SDL_Keysym *
578- DirectFB_TranslateKey (_THIS , DFBWindowEvent * evt , SDL_Keysym * keysym )
580+ DirectFB_TranslateKey (_THIS , DFBWindowEvent * evt , SDL_Keysym * keysym , Uint32 * unicode )
579581{
580582 SDL_DFB_DEVICEDATA (_this );
581583 int kbd_idx = 0 ; /* Window events lag the device source KbdIndex(_this, evt->device_id); */
@@ -595,18 +597,18 @@ DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt, SDL_Keysym * keysym)
595597 keysym -> scancode = SDL_SCANCODE_UNKNOWN ;
596598 }
597599
598- keysym -> unicode =
600+ * unicode =
599601 (DFB_KEY_TYPE (evt -> key_symbol ) == DIKT_UNICODE ) ? evt -> key_symbol : 0 ;
600- if (keysym -> unicode == 0 &&
602+ if (* unicode == 0 &&
601603 (evt -> key_symbol > 0 && evt -> key_symbol < 255 ))
602- keysym -> unicode = evt -> key_symbol ;
604+ * unicode = evt -> key_symbol ;
603605
604606 return keysym ;
605607}
606608
607609static SDL_Keysym *
608610DirectFB_TranslateKeyInputEvent (_THIS , DFBInputEvent * evt ,
609- SDL_Keysym * keysym )
611+ SDL_Keysym * keysym , Uint32 * unicode )
610612{
611613 SDL_DFB_DEVICEDATA (_this );
612614 int kbd_idx = KbdIndex (_this , evt -> device_id );
@@ -625,11 +627,11 @@ DirectFB_TranslateKeyInputEvent(_THIS, DFBInputEvent * evt,
625627 keysym -> scancode = SDL_SCANCODE_UNKNOWN ;
626628 }
627629
628- keysym -> unicode =
630+ * unicode =
629631 (DFB_KEY_TYPE (evt -> key_symbol ) == DIKT_UNICODE ) ? evt -> key_symbol : 0 ;
630- if (keysym -> unicode == 0 &&
632+ if (* unicode == 0 &&
631633 (evt -> key_symbol > 0 && evt -> key_symbol < 255 ))
632- keysym -> unicode = evt -> key_symbol ;
634+ * unicode = evt -> key_symbol ;
633635
634636 return keysym ;
635637}
0 commit comments