diff --git a/config.def.h b/config.def.h index 22b692b..eae70c4 100644 --- a/config.def.h +++ b/config.def.h @@ -262,6 +262,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 index 1467839..776d12b 100644 --- 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; }