mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-01 23:48:29 +00:00
Implement keyboard grab support for Wayland
Use zwp_keyboard_shortcuts_inhibit_manager_v1 to allow SDL applications to capture system keyboard shortcuts like Alt+Tab when keyboard grab is enabled via SDL_HINT_GRAB_KEYBOARD.
This commit is contained in:
@@ -636,10 +636,15 @@ Wayland_SetWindowGrab(_THIS, SDL_Window *window, SDL_bool grabbed)
|
||||
{
|
||||
SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
|
||||
|
||||
if (grabbed)
|
||||
if (grabbed) {
|
||||
Wayland_input_confine_pointer(window, data->input);
|
||||
else
|
||||
|
||||
if (SDL_GetHintBoolean(SDL_HINT_GRAB_KEYBOARD, SDL_FALSE))
|
||||
Wayland_input_grab_keyboard(window, data->input);
|
||||
} else {
|
||||
Wayland_input_ungrab_keyboard(window);
|
||||
Wayland_input_unconfine_pointer(data->input);
|
||||
}
|
||||
}
|
||||
|
||||
int Wayland_CreateWindow(_THIS, SDL_Window *window)
|
||||
|
Reference in New Issue
Block a user