Implement grab keyboard for x11
This commit is contained in:
parent
d8b0edce43
commit
255dd2845e
1 changed files with 7 additions and 2 deletions
9
glfw/x11_window.c
vendored
9
glfw/x11_window.c
vendored
|
|
@ -3386,8 +3386,13 @@ _glfwPlatformSetWindowBlur(_GLFWwindow *window, int blur_radius) {
|
|||
|
||||
bool
|
||||
_glfwPlatformGrabKeyboard(bool grab) {
|
||||
if (grab) _glfwInputError(GLFW_PLATFORM_ERROR, "X11: Grabbing of keyboard is not currently supported");
|
||||
return false;
|
||||
int result;
|
||||
if (grab) {
|
||||
result = XGrabKeyboard(_glfw.x11.display, _glfw.x11.root, True, GrabModeAsync, GrabModeAsync, CurrentTime);
|
||||
} else {
|
||||
result = XUngrabKeyboard(_glfw.x11.display, CurrentTime);
|
||||
}
|
||||
return result == GrabSuccess;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
Loading…
Reference in a new issue