Mercurial > sdl-ios-xcode
comparison src/video/x11/SDL_x11window.c @ 2325:c7bcf84ba1b9
Next version of internationalized input for X11. On my machine (famous last words :-) with a US English keyboard and locale I can compose ` and e and get a text
input event with the character รจ. You still get the keypress keyrelease events for the individual keys that go into composing the character.
author | Bob Pendleton <bob@pendleton.com> |
---|---|
date | Fri, 07 Mar 2008 20:54:11 +0000 |
parents | 3202e4826c57 |
children | 44e49d3fa6cf 64f346a83ed3 |
comparison
equal
deleted
inserted
replaced
2324:3202e4826c57 | 2325:c7bcf84ba1b9 |
---|---|
453 wmhints->flags = InputHint; | 453 wmhints->flags = InputHint; |
454 XSetWMHints(data->display, w, wmhints); | 454 XSetWMHints(data->display, w, wmhints); |
455 XFree(wmhints); | 455 XFree(wmhints); |
456 } | 456 } |
457 | 457 |
458 XSelectInput(data->display, w, | |
459 (FocusChangeMask | EnterWindowMask | LeaveWindowMask | | |
460 ExposureMask | ButtonPressMask | ButtonReleaseMask | | |
461 PointerMotionMask | KeyPressMask | KeyReleaseMask | | |
462 PropertyChangeMask | StructureNotifyMask | | |
463 KeymapStateMask)); | |
464 | |
465 /* Set the class hints so we can get an icon (AfterStep) */ | 458 /* Set the class hints so we can get an icon (AfterStep) */ |
466 classhints = XAllocClassHint(); | 459 classhints = XAllocClassHint(); |
467 if (classhints != NULL) { | 460 if (classhints != NULL) { |
468 classhints->res_name = data->classname; | 461 classhints->res_name = data->classname; |
469 classhints->res_class = data->classname; | 462 classhints->res_class = data->classname; |
479 if (window->flags & SDL_WINDOW_OPENGL) { | 472 if (window->flags & SDL_WINDOW_OPENGL) { |
480 X11_GL_Shutdown(_this); | 473 X11_GL_Shutdown(_this); |
481 } | 474 } |
482 #endif | 475 #endif |
483 XDestroyWindow(data->display, w); | 476 XDestroyWindow(data->display, w); |
484 X11_PumpEvents(_this); | |
485 return -1; | 477 return -1; |
486 } | 478 } |
479 #ifdef X_HAVE_UTF8_STRING | |
480 { | |
481 Uint32 fevent = 0; | |
482 pXGetICValues(((SDL_WindowData *) window->driverdata)->ic, | |
483 XNFilterEvents, &fevent, NULL); | |
484 XSelectInput(data->display, w, | |
485 (FocusChangeMask | EnterWindowMask | LeaveWindowMask | | |
486 ExposureMask | ButtonPressMask | ButtonReleaseMask | | |
487 PointerMotionMask | KeyPressMask | KeyReleaseMask | | |
488 PropertyChangeMask | StructureNotifyMask | | |
489 KeymapStateMask | fevent)); | |
490 } | |
491 #else | |
492 XSelectInput(data->display, w, | |
493 (FocusChangeMask | EnterWindowMask | LeaveWindowMask | | |
494 ExposureMask | ButtonPressMask | ButtonReleaseMask | | |
495 PointerMotionMask | KeyPressMask | KeyReleaseMask | | |
496 PropertyChangeMask | StructureNotifyMask | | |
497 KeymapStateMask)); | |
498 #endif | |
499 | |
487 return 0; | 500 return 0; |
488 } | 501 } |
489 | 502 |
490 int | 503 int |
491 X11_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) | 504 X11_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) |
678 XDestroyIC(data->ic); | 691 XDestroyIC(data->ic); |
679 } | 692 } |
680 #endif | 693 #endif |
681 if (data->created) { | 694 if (data->created) { |
682 XDestroyWindow(display, data->window); | 695 XDestroyWindow(display, data->window); |
683 X11_PumpEvents(_this); | |
684 } | 696 } |
685 SDL_free(data); | 697 SDL_free(data); |
686 } | 698 } |
687 } | 699 } |
688 | 700 |