diff options
| -rw-r--r-- | config.def.h | 14 | ||||
| -rw-r--r-- | x.c | 12 |
2 files changed, 13 insertions, 13 deletions
diff --git a/config.def.h b/config.def.h index 36ff6ce..a0a0d2d 100644 --- a/config.def.h +++ b/config.def.h | |||
| @@ -151,6 +151,13 @@ static unsigned int mousebg = 0; | |||
| 151 | static unsigned int defaultattr = 11; | 151 | static unsigned int defaultattr = 11; |
| 152 | 152 | ||
| 153 | /* | 153 | /* |
| 154 | * Force mouse select/shortcuts while mask is active (when MODE_MOUSE is set). | ||
| 155 | * Note that if you want to use ShiftMask with selmasks, set this to an other | ||
| 156 | * modifier, set to 0 to not use it. | ||
| 157 | */ | ||
| 158 | static uint forcemousemod = ShiftMask; | ||
| 159 | |||
| 160 | /* | ||
| 154 | * Internal mouse shortcuts. | 161 | * Internal mouse shortcuts. |
| 155 | * Beware that overloading Button1 will disable the selection. | 162 | * Beware that overloading Button1 will disable the selection. |
| 156 | */ | 163 | */ |
| @@ -214,13 +221,6 @@ static KeySym mappedkeys[] = { -1 }; | |||
| 214 | static uint ignoremod = Mod2Mask|XK_SWITCH_MOD; | 221 | static uint ignoremod = Mod2Mask|XK_SWITCH_MOD; |
| 215 | 222 | ||
| 216 | /* | 223 | /* |
| 217 | * Override mouse-select while mask is active (when MODE_MOUSE is set). | ||
| 218 | * Note that if you want to use ShiftMask with selmasks, set this to an other | ||
| 219 | * modifier, set to 0 to not use it. | ||
| 220 | */ | ||
| 221 | static uint forceselmod = ShiftMask; | ||
| 222 | |||
| 223 | /* | ||
| 224 | * This is the huge key array which defines all compatibility to the Linux | 224 | * This is the huge key array which defines all compatibility to the Linux |
| 225 | * world. Please decide about changes wisely. | 225 | * world. Please decide about changes wisely. |
| 226 | */ | 226 | */ |
| @@ -340,7 +340,7 @@ void | |||
| 340 | mousesel(XEvent *e, int done) | 340 | mousesel(XEvent *e, int done) |
| 341 | { | 341 | { |
| 342 | int type, seltype = SEL_REGULAR; | 342 | int type, seltype = SEL_REGULAR; |
| 343 | uint state = e->xbutton.state & ~(Button1Mask | forceselmod); | 343 | uint state = e->xbutton.state & ~(Button1Mask | forcemousemod); |
| 344 | 344 | ||
| 345 | for (type = 1; type < LEN(selmasks); ++type) { | 345 | for (type = 1; type < LEN(selmasks); ++type) { |
| 346 | if (match(selmasks[type], state)) { | 346 | if (match(selmasks[type], state)) { |
| @@ -423,14 +423,14 @@ bpress(XEvent *e) | |||
| 423 | MouseShortcut *ms; | 423 | MouseShortcut *ms; |
| 424 | int snap; | 424 | int snap; |
| 425 | 425 | ||
| 426 | if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) { | 426 | if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forcemousemod)) { |
| 427 | mousereport(e); | 427 | mousereport(e); |
| 428 | return; | 428 | return; |
| 429 | } | 429 | } |
| 430 | 430 | ||
| 431 | for (ms = mshortcuts; ms < mshortcuts + LEN(mshortcuts); ms++) { | 431 | for (ms = mshortcuts; ms < mshortcuts + LEN(mshortcuts); ms++) { |
| 432 | if (e->xbutton.button == ms->button | 432 | if (e->xbutton.button == ms->button && |
| 433 | && match(ms->mod, e->xbutton.state)) { | 433 | match(ms->mod, e->xbutton.state & ~forcemousemod)) { |
| 434 | ms->func(&(ms->arg)); | 434 | ms->func(&(ms->arg)); |
| 435 | return; | 435 | return; |
| 436 | } | 436 | } |
| @@ -650,7 +650,7 @@ xsetsel(char *str) | |||
| 650 | void | 650 | void |
| 651 | brelease(XEvent *e) | 651 | brelease(XEvent *e) |
| 652 | { | 652 | { |
| 653 | if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) { | 653 | if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forcemousemod)) { |
| 654 | mousereport(e); | 654 | mousereport(e); |
| 655 | return; | 655 | return; |
| 656 | } | 656 | } |
| @@ -664,7 +664,7 @@ brelease(XEvent *e) | |||
| 664 | void | 664 | void |
| 665 | bmotion(XEvent *e) | 665 | bmotion(XEvent *e) |
| 666 | { | 666 | { |
| 667 | if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) { | 667 | if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forcemousemod)) { |
| 668 | mousereport(e); | 668 | mousereport(e); |
| 669 | return; | 669 | return; |
| 670 | } | 670 | } |
