| Summary: | Keyboard layout change during SDL application is not recognized in Fedora 25 Linux used with LXDE/X11 | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Bencsik Roland <roland.bencsik> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | icculus |
| Version: | 2.0.5 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: |
XKB keyboard layout switch tester
SDL x11 keyboard layout change patch Gzipped SDL x11 keyboard layout change patch |
||
Created attachment 2924 [details]
SDL x11 keyboard layout change patch
Created attachment 2925 [details] Gzipped SDL x11 keyboard layout change patch Patch is big due to "xevent.type" => "xevent->type" changes in X11_DispatchEvent(), because of XkbEvent xkbevent; XEvent * xevent; xevent = &(xkbevent.core); X11_XNextEvent(display, xevent); which was suggested in https://www.x.org/docs/XKB/XKBlib.pdf page 18. We added support for system keymap changes at some point, so this is fixed now. --ryan. |
Created attachment 2923 [details] XKB keyboard layout switch tester Switching between US and Hungarian keyboard layouts during SDL application is not recognized, because MappingNotify is not sent by X11 to SDL. Components: OS: Fedora 25 Linux X11: X.Org X Server 1.19.0 Release Date: 2016-11-15, X Protocol Version 11, Revision 0, Build ID: xorg-x11-server 1.19.0-1.fc25 LXDE: lxdm (version: 0.5.3, release: 5.D20161111gita548c73e.fc25) LXDE Keyboard Layout Handler plugin: lxpanel (version: 0.9.1, release: 1.fc25) setxkbmap: 1.3.1 However when subscribing for XkbNewKeyboardNotify, XkbMapNotify and XkbStateNotify events X11 sends XKB events which can be used to detect layout change. Test program is attached. Tested cases: 1. switch layout by its key combination (for example both shift keys), 2. switch layout by clicking on LXDE Keyboard Layout Handler plugin layout button, 3. using "setxkbmap -layout us" and "setxkbmap -layout hu". Case 3. only works for me if LXDE Keyboard Layout Handler plugin is removed from lxpanel. The US and Hungarian keyboard have difference at least in the '`', '0' keys.