mirror of
https://github.com/mintycube/st.git
synced 2024-10-22 14:05:49 +02:00
mouse shortcuts: allow override for all shortcuts (7729e7)
This commit is contained in:
parent
584f3928ad
commit
ed7837a816
14
config.def.h
14
config.def.h
@ -262,6 +262,13 @@ ResourcePref resources[] = {
|
|||||||
};
|
};
|
||||||
#endif // XRESOURCES_PATCH
|
#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.
|
* Internal mouse shortcuts.
|
||||||
* Beware that overloading Button1 will disable the selection.
|
* Beware that overloading Button1 will disable the selection.
|
||||||
@ -373,13 +380,6 @@ static KeySym mappedkeys[] = { -1 };
|
|||||||
*/
|
*/
|
||||||
static uint ignoremod = Mod2Mask|XK_SWITCH_MOD;
|
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
|
#if !FIXKEYBOARDINPUT_PATCH
|
||||||
/*
|
/*
|
||||||
* This is the huge key array which defines all compatibility to the Linux
|
* This is the huge key array which defines all compatibility to the Linux
|
||||||
|
12
x.c
12
x.c
@ -390,7 +390,7 @@ void
|
|||||||
mousesel(XEvent *e, int done)
|
mousesel(XEvent *e, int done)
|
||||||
{
|
{
|
||||||
int type, seltype = SEL_REGULAR;
|
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) {
|
for (type = 1; type < LEN(selmasks); ++type) {
|
||||||
if (match(selmasks[type], state)) {
|
if (match(selmasks[type], state)) {
|
||||||
@ -476,7 +476,7 @@ bpress(XEvent *e)
|
|||||||
#endif // SCROLLBACK_MOUSE_PATCH / SCROLLBACK_MOUSE_ALTSCREEN_PATCH
|
#endif // SCROLLBACK_MOUSE_PATCH / SCROLLBACK_MOUSE_ALTSCREEN_PATCH
|
||||||
int snap;
|
int snap;
|
||||||
|
|
||||||
if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) {
|
if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forcemousemod)) {
|
||||||
mousereport(e);
|
mousereport(e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -485,8 +485,8 @@ bpress(XEvent *e)
|
|||||||
if (tisaltscr())
|
if (tisaltscr())
|
||||||
#endif // SCROLLBACK_MOUSE_ALTSCREEN_PATCH
|
#endif // SCROLLBACK_MOUSE_ALTSCREEN_PATCH
|
||||||
for (ms = mshortcuts; ms < mshortcuts + LEN(mshortcuts); ms++) {
|
for (ms = mshortcuts; ms < mshortcuts + LEN(mshortcuts); ms++) {
|
||||||
if (e->xbutton.button == ms->button
|
if (e->xbutton.button == ms->button &&
|
||||||
&& match(ms->mod, e->xbutton.state)) {
|
match(ms->mod, e->xbutton.state & ~forcemousemod)) {
|
||||||
ms->func(&(ms->arg));
|
ms->func(&(ms->arg));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -720,7 +720,7 @@ xsetsel(char *str)
|
|||||||
void
|
void
|
||||||
brelease(XEvent *e)
|
brelease(XEvent *e)
|
||||||
{
|
{
|
||||||
if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) {
|
if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forcemousemod)) {
|
||||||
mousereport(e);
|
mousereport(e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -751,7 +751,7 @@ bmotion(XEvent *e)
|
|||||||
}
|
}
|
||||||
#endif // HIDECURSOR_PATCH
|
#endif // HIDECURSOR_PATCH
|
||||||
|
|
||||||
if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) {
|
if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forcemousemod)) {
|
||||||
mousereport(e);
|
mousereport(e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user