mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-29 14:38:29 +00:00
x11: Modernize and optimize key handling
- Use modern Xkb functions where appropriate and cleanly separate the modern and legacy paths. - Remove the deprecated XKeycodeToKeysym function in favor of directly querying the keymap on the legacy path. - Look up virtual modifiers by name on the Xkb path to better handle remapping (equivalent to the modifier handling under Wayland). - Optimize keymap creation on the Xkb path to cut keymap build times and enable fast group switching (equivalent to keymap handling on Wayland). - Enable and handle Xkb events to handle changes to the group, mapping, and modifier states. This is more reliable than using the legacy events (group changes may not arrive if the window lacks pointer focus), and better handles cases where modifiers are latched, locked, or activated externally rather than physically pressed.
This commit is contained in:

committed by
Sam Lantinga

parent
67e5130441
commit
f439e44771
@@ -422,7 +422,7 @@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR @SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS @SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XTEST @SDL_VIDEO_DRIVER_X11_DYNAMIC_XTEST@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_HAS_XKBLOOKUPKEYSYM 1
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_HAS_XKBLIB 1
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_XCURSOR 1
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_XDBE 1
|
||||
|
Reference in New Issue
Block a user