aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2017-03-05 23:51:24 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-08-27 14:10:16 +0200
commit58183b7ceacb774b018bd61e6ad6c127662c7fcb (patch)
treec363adf91d180fcd3364f14495034bd9a03b1246 /nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
parentdaa50fd80ed5f777754a51c0e2b4869ba083a337 (diff)
downloadnx-libs-58183b7ceacb774b018bd61e6ad6c127662c7fcb.tar.gz
nx-libs-58183b7ceacb774b018bd61e6ad6c127662c7fcb.tar.bz2
nx-libs-58183b7ceacb774b018bd61e6ad6c127662c7fcb.zip
nxagent: Add autograb mode.
You can now toggle between autograb mode by pressing CTRL-ALT-G (default, can be adjusted in keystrokes.cfg). Fixes ArcticaProject/nx-libs#384.
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Keystroke.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Keystroke.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
index fe7e10d82..fb2979a1f 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
@@ -99,6 +99,9 @@ char * nxagentSpecialKeystrokeNames[] = {
"viewport_scroll_down",
"reread_keystrokes",
+
+ "autograb",
+
NULL,
};
@@ -138,6 +141,7 @@ struct nxagentSpecialKeystrokeMap default_map[] = {
{KEYSTROKE_VIEWPORT_SCROLL_DOWN, ControlMask, True, XK_Down},
{KEYSTROKE_VIEWPORT_SCROLL_DOWN, ControlMask, True, XK_KP_Down},
{KEYSTROKE_REREAD_KEYSTROKES, ControlMask, True, XK_k},
+ {KEYSTROKE_AUTOGRAB, ControlMask, True, XK_g},
{KEYSTROKE_END_MARKER, 0, False, NoSymbol},
};
struct nxagentSpecialKeystrokeMap *map = default_map;
@@ -467,7 +471,7 @@ static enum nxagentSpecialKeystroke find_keystroke(XKeyEvent *X)
#endif
for (struct nxagentSpecialKeystrokeMap *cur = map; cur->stroke != KEYSTROKE_END_MARKER; cur++) {
#ifdef DEBUG
- fprintf(stderr, "%s: checking keysym '%c' (%d)\n", __func__, cur->keysym, cur->keysym);
+ fprintf(stderr,"%s: keysym %d stroke %d, type %d\n", __func__, cur->keysym, cur->stroke, X->type);
#endif
if (cur->keysym == keysym && modifier_matches(cur->modifierMask, cur->modifierAltMeta, X->state)) {
#ifdef DEBUG
@@ -627,6 +631,9 @@ Bool nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result)
if (X->type == KeyRelease)
nxagentInitKeystrokes(True);
break;
+ case KEYSTROKE_AUTOGRAB:
+ *result = doAutoGrab;
+ break;
case KEYSTROKE_NOTHING: /* do nothing. difference to KEYSTROKE_IGNORE is the return value */
case KEYSTROKE_END_MARKER: /* just to make gcc STFU */
case KEYSTROKE_MAX: