summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2025-02-08 00:29:10 -0800
committerVito Caputo <vcaputo@pengaru.com>2025-02-08 00:29:10 -0800
commitbeac2ba833b912b819fae48ec268373ee994efbd (patch)
treee1e3835672748348d185cb7901dcbd69be61b4d9
parented9a5c733903eb3744a6b8819779a2edd2bafdc0 (diff)
key: early support for XK_m modifier to chase focus
Particularly on large multi-head display setups it can be annoying to have to find the mouse pointer after long periods of not using it, on the rare occasion one must bring it to the currently focused window to do a pointer operation. This commit introduces XK_m for controlling a "chase_it" flag, which future commits will utilize for augmenting focus-changing operations, and maybe window configuring operations, by warping the pointer to the center of the focused window /after/ the augmented operation has been performed.
-rw-r--r--src/key.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/key.c b/src/key.c
index e40a3d1..4061236 100644
--- a/src/key.c
+++ b/src/key.c
@@ -32,6 +32,7 @@
static int key_is_grabbed; /* flag for tracking keyboard grab state */
static vwm_direction_t direction = VWM_DIRECTION_FORWARD; /* flag for reversing directional actions */
static int send_it; /* flag for "sending" a migration operation without following it */
+static int chase_it; /* flag for "chasing" a focus operation with the pointer */
/* Poll the keyboard state to see if _any_ keys are pressed */
static int keys_pressed(vwm_t *vwm)
@@ -80,6 +81,12 @@ void vwm_key_released(vwm_t *vwm, Window win, XKeyReleasedEvent *keyrelease)
break;
+ case XK_m:
+ VWM_TRACE("XK_m released with chase_it=%i", chase_it);
+ chase_it = 0;
+ break;
+
+
case XK_r:
VWM_TRACE("XK_r released with direction=%i", direction);
direction = VWM_DIRECTION_FORWARD;
@@ -144,6 +151,11 @@ void vwm_key_pressed(vwm_t *vwm, Window win, XKeyPressedEvent *keypress)
VWM_TRACE("aborting with origin %p", vwm->focused_origin);
break;
+ case XK_m: /* "chase" focus actions with pointer */
+ VWM_TRACE("XK_r pressed with chase_it=%i", chase_it);
+ chase_it = 1;
+ break;
+
case XK_r: /* reverse directional actions */
VWM_TRACE("XK_r pressed with direction=%i", direction);
direction = VWM_DIRECTION_REVERSE;
© All Rights Reserved