mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 08:54:38 +09:00
Merge pull request #11195 from akallabeth/sdl-kbd-grab
[client,sdl] fix keyboard grab
This commit is contained in:
@@ -373,11 +373,11 @@ BOOL sdlDispContext::handle_window_event(const SDL_WindowEvent* ev)
|
||||
|
||||
case SDL_WINDOWEVENT_LEAVE:
|
||||
WINPR_ASSERT(_sdl);
|
||||
_sdl->input.keyboard_grab(ev->windowID, SDL_FALSE);
|
||||
_sdl->input.keyboard_grab(ev->windowID, false);
|
||||
return TRUE;
|
||||
case SDL_WINDOWEVENT_ENTER:
|
||||
WINPR_ASSERT(_sdl);
|
||||
_sdl->input.keyboard_grab(ev->windowID, SDL_TRUE);
|
||||
_sdl->input.keyboard_grab(ev->windowID, true);
|
||||
return _sdl->input.keyboard_focus_in();
|
||||
case SDL_WINDOWEVENT_FOCUS_GAINED:
|
||||
case SDL_WINDOWEVENT_TAKE_FOCUS:
|
||||
|
||||
@@ -503,8 +503,7 @@ BOOL sdlInput::keyboard_handle_event(const SDL_KeyboardEvent* ev)
|
||||
|
||||
if (ev->keysym.scancode == _hotkeyGrab)
|
||||
{
|
||||
_sdl->grab_kbd_enabled = !_sdl->grab_kbd_enabled;
|
||||
keyboard_grab(ev->windowID, _sdl->grab_kbd ? SDL_FALSE : SDL_TRUE);
|
||||
keyboard_grab(ev->windowID, !_sdl->grab_kbd);
|
||||
return TRUE;
|
||||
}
|
||||
if (ev->keysym.scancode == _hotkeyDisconnect)
|
||||
@@ -525,7 +524,7 @@ BOOL sdlInput::keyboard_handle_event(const SDL_KeyboardEvent* ev)
|
||||
ev->repeat, scancode);
|
||||
}
|
||||
|
||||
BOOL sdlInput::keyboard_grab(Uint32 windowID, SDL_bool enable)
|
||||
BOOL sdlInput::keyboard_grab(Uint32 windowID, bool enable)
|
||||
{
|
||||
auto it = _sdl->windows.find(windowID);
|
||||
if (it == _sdl->windows.end())
|
||||
|
||||
@@ -47,7 +47,7 @@ class sdlInput
|
||||
|
||||
BOOL keyboard_handle_event(const SDL_KeyboardEvent* ev);
|
||||
|
||||
BOOL keyboard_grab(Uint32 windowID, SDL_bool enable);
|
||||
BOOL keyboard_grab(Uint32 windowID, bool enable);
|
||||
BOOL mouse_focus(Uint32 windowID);
|
||||
BOOL mouse_grab(Uint32 windowID, SDL_bool enable);
|
||||
|
||||
|
||||
@@ -475,8 +475,7 @@ BOOL sdlInput::keyboard_handle_event(const SDL_KeyboardEvent* ev)
|
||||
|
||||
if (ev->scancode == _hotkeyGrab)
|
||||
{
|
||||
_sdl->grab_kbd_enabled = !_sdl->grab_kbd_enabled;
|
||||
keyboard_grab(ev->windowID, _sdl->grab_kbd);
|
||||
keyboard_grab(ev->windowID, !_sdl->grab_kbd);
|
||||
return TRUE;
|
||||
}
|
||||
if (ev->scancode == _hotkeyDisconnect)
|
||||
|
||||
Reference in New Issue
Block a user