commit ed7837a816b40b7a06fcbef209ae2dfb01dd07e9
parent 584f3928add5146e9fc678743a72e1ee35d42d74
Author: bakkeby <bakkeby@gmail.com>
Date: Tue, 24 Mar 2020 14:08:08 +0100
mouse shortcuts: allow override for all shortcuts (7729e7)
Diffstat:
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/config.def.h b/config.def.h
@@ -263,6 +263,13 @@ ResourcePref resources[] = {
#endif // XRESOURCES_PATCH
/*
+ * Force mouse select/shortcuts while mask is active (when MODE_MOUSE is set).
+ * Note that if you want to use ShiftMask with selmasks, set this to an other
+ * modifier, set to 0 to not use it.
+ */
+static uint forcemousemod = ShiftMask;
+
+/*
* Internal mouse shortcuts.
* Beware that overloading Button1 will disable the selection.
*/
@@ -373,13 +380,6 @@ static KeySym mappedkeys[] = { -1 };
*/
static uint ignoremod = Mod2Mask|XK_SWITCH_MOD;
-/*
- * Override mouse-select while mask is active (when MODE_MOUSE is set).
- * Note that if you want to use ShiftMask with selmasks, set this to an other
- * modifier, set to 0 to not use it.
- */
-static uint forceselmod = ShiftMask;
-
#if !FIXKEYBOARDINPUT_PATCH
/*
* This is the huge key array which defines all compatibility to the Linux
diff --git a/x.c b/x.c
@@ -390,7 +390,7 @@ void
mousesel(XEvent *e, int done)
{
int type, seltype = SEL_REGULAR;
- uint state = e->xbutton.state & ~(Button1Mask | forceselmod);
+ uint state = e->xbutton.state & ~(Button1Mask | forcemousemod);
for (type = 1; type < LEN(selmasks); ++type) {
if (match(selmasks[type], state)) {
@@ -476,7 +476,7 @@ bpress(XEvent *e)
#endif // SCROLLBACK_MOUSE_PATCH / SCROLLBACK_MOUSE_ALTSCREEN_PATCH
int snap;
- if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) {
+ if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forcemousemod)) {
mousereport(e);
return;
}
@@ -485,8 +485,8 @@ bpress(XEvent *e)
if (tisaltscr())
#endif // SCROLLBACK_MOUSE_ALTSCREEN_PATCH
for (ms = mshortcuts; ms < mshortcuts + LEN(mshortcuts); ms++) {
- if (e->xbutton.button == ms->button
- && match(ms->mod, e->xbutton.state)) {
+ if (e->xbutton.button == ms->button &&
+ match(ms->mod, e->xbutton.state & ~forcemousemod)) {
ms->func(&(ms->arg));
return;
}
@@ -720,7 +720,7 @@ xsetsel(char *str)
void
brelease(XEvent *e)
{
- if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) {
+ if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forcemousemod)) {
mousereport(e);
return;
}
@@ -751,7 +751,7 @@ bmotion(XEvent *e)
}
#endif // HIDECURSOR_PATCH
- if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) {
+ if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forcemousemod)) {
mousereport(e);
return;
}