Skip to content

Instantly share code, notes, and snippets.

@khvMX
Created February 26, 2015 10:21
Show Gist options
  • Save khvMX/66e0b14c71a32aca1bc7 to your computer and use it in GitHub Desktop.
Save khvMX/66e0b14c71a32aca1bc7 to your computer and use it in GitHub Desktop.
From 96d29ba9ef326f7ed3c9adc1b463c011c09787b1 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 | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/client/X11/xf_keyboard.c b/client/X11/xf_keyboard.c
index f09d6a9..a90b8ba 100644
--- a/client/X11/xf_keyboard.c
+++ b/client/X11/xf_keyboard.c
@@ -441,7 +441,7 @@ BOOL xf_keyboard_handle_special_keys(xfContext* xfc, KeySym keysym)
XF_MODIFIER_KEYS mod = { 0 };
xk_keyboard_get_modifier_keys(xfc, &mod);
-
+
if (!xf_keyboard_execute_action_script(xfc, &mod, keysym))
{
return TRUE;
@@ -469,6 +469,22 @@ BOOL xf_keyboard_handle_special_keys(xfContext* xfc, KeySym keysym)
return TRUE;
}
}
+
+ // Ungrab keyboard
+ // FIXME this works with Windowed version, but not when in Fullscreen!
+ if (mod.RightCtrl) // TODO make an option to choose which button combination does it
+ {
+ if (!xfc->fullscreen)
+ {
+ XUngrabKeyboard(xfc->display, CurrentTime);
+ return TRUE;
+ }
+ else
+ {
+ // TODO not just ungrab keyboard,
+ // but also e.g., make it possible to switch gnome workspaces correctly
+ }
+ }
#if 0 /* set to 1 to enable multi touch gesture simulation via keyboard */
#ifdef WITH_XRENDER
--
1.9.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment