Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
From 12b54b17dfe145793c9eec48d47ddc5e65667743 Mon Sep 17 00:00:00 2001
From: Viktor Mukha <viktor.mukha@ar-tracking.de>
Date: Thu, 26 Feb 2015 11:13:42 +0100
Subject: [PATCH] [#49] Trying to release keyboard grab (currently with Right
Ctrl)
---
client/X11/xf_keyboard.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/client/X11/xf_keyboard.c b/client/X11/xf_keyboard.c
index 3e11b95..29d2068 100644
--- a/client/X11/xf_keyboard.c
+++ b/client/X11/xf_keyboard.c
@@ -488,6 +488,22 @@ BOOL xf_keyboard_handle_special_keys(xfContext* xfc, KeySym keysym)
return TRUE;
}
}
+
+ // Ungrab keyboard
+ if (mod.RightCtrl) // TODO make an option to choose which button combination does it
+ {
+ if (!xfc->fullscreen)
+ {
+ XUngrabKeyboard(xfc->display, CurrentTime);
+ return TRUE;
+ }
+ else
+ {
+ xf_toggle_control(xfc);
+ XUngrabKeyboard(xfc->display, CurrentTime);
+ return TRUE;
+ }
+ }
#if 0 /* set to 1 to enable multi touch gesture simulation via keyboard */
#ifdef WITH_XRENDER
--
2.7.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.