Hello,
Classical example of when this is required is Midnight Commander - it
have useful mouse integration, but copy-pasting a filename or two is
sometimes a nice thing to be able to do. Some other terminal emulators
achieve this by not sending mouse events to the program whenever "Shift"
is pressed, and instead processing such events themselves. This patch
does just this.
--Andy
>From 67e346c8622f6b8f2b3b22ea761b5027765a6088 Mon Sep 17 00:00:00 2001
From: Andy Chernyak <andy.chern...@gmail.com>
Date: Wed, 12 Feb 2014 00:01:50 +0100
Subject: [PATCH] Allow mouse copy-paste for programs that claim mouse to
themselves by holding shift
---
st.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/st.c b/st.c
index cad61bf..c7b9fd5 100644
--- a/st.c
+++ b/st.c
@@ -898,7 +898,7 @@ bpress(XEvent *e) {
struct timeval now;
Mousekey *mk;
- if(IS_SET(MODE_MOUSE)) {
+ if(IS_SET(MODE_MOUSE) && !(e->xbutton.state & ShiftMask)) {
mousereport(e);
return;
}
@@ -1126,7 +1126,7 @@ xsetsel(char *str) {
void
brelease(XEvent *e) {
- if(IS_SET(MODE_MOUSE)) {
+ if(IS_SET(MODE_MOUSE) && !(e->xbutton.state & ShiftMask)) {
mousereport(e);
return;
}
@@ -1149,7 +1149,7 @@ void
bmotion(XEvent *e) {
int oldey, oldex, oldsby, oldsey;
- if(IS_SET(MODE_MOUSE)) {
+ if(IS_SET(MODE_MOUSE) && !(e->xbutton.state & ShiftMask)) {
mousereport(e);
return;
}
--
1.8.5.3