Implement grab keyboard for x11
This commit is contained in:
9
glfw/x11_window.c
vendored
9
glfw/x11_window.c
vendored
@@ -3386,8 +3386,13 @@ _glfwPlatformSetWindowBlur(_GLFWwindow *window, int blur_radius) {
|
|||||||
|
|
||||||
bool
|
bool
|
||||||
_glfwPlatformGrabKeyboard(bool grab) {
|
_glfwPlatformGrabKeyboard(bool grab) {
|
||||||
if (grab) _glfwInputError(GLFW_PLATFORM_ERROR, "X11: Grabbing of keyboard is not currently supported");
|
int result;
|
||||||
return false;
|
if (grab) {
|
||||||
|
result = XGrabKeyboard(_glfw.x11.display, _glfw.x11.root, True, GrabModeAsync, GrabModeAsync, CurrentTime);
|
||||||
|
} else {
|
||||||
|
result = XUngrabKeyboard(_glfw.x11.display, CurrentTime);
|
||||||
|
}
|
||||||
|
return result == GrabSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
Reference in New Issue
Block a user