Treat shift-button-3 as button-2. - sam - An updated version of the sam text editor.
(HTM) git clone git://vernunftzentrum.de/sam.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit 398c9890f56cb779ebaee2280c43988b3b134e8e
(DIR) parent 4e17c4ff737cc7801d44c53bddc139aa2d0eaa26
(HTM) Author: Rob King <jking@deadpixi.com>
Date: Sun, 1 May 2016 00:56:28 -0500
Treat shift-button-3 as button-2.
This make sam much more usable with a two-button mouse, or on a
touchpad.
Diffstat:
doc/sam.1 | 5 ++---
libXg/gwin.c | 2 +-
2 files changed, 3 insertions(+), 4 deletions(-)
---
(DIR) diff --git a/doc/sam.1 b/doc/sam.1
@@ -732,7 +732,7 @@ Button 1 changes the selection.
Pointing to a non-current window with button 1 makes it current; within the current window, button 1 selects text, thus setting dot.
Double-clicking selects text to the boundaries of words, lines, quoted strings, or bracketed strings, depending on the text at the click.
.Pp
-Button 2 provides a menu of editing commands:
+Button 2 (or button 3 combined with the shift key) provides a menu of editing commands:
.Bl -tag -width Ds
.It Sy cut
Delete dot and save the delted text in the snarf buffer.
@@ -1033,4 +1033,4 @@ The only human language in which colors may be specified is English.
.Pp
The only human language in which output is generated is English.
.Pp
-There is no support for right-to-left text, ligatures, composed characters, or any other complex text rendering.
-\ No newline at end of file
+There is no support for right-to-left text, ligatures, composed characters, or any other complex text rendering.
(DIR) diff --git a/libXg/gwin.c b/libXg/gwin.c
@@ -356,7 +356,7 @@ Mouseaction(Widget w, XEvent *e, String *p, Cardinal *np)
m.buttons = 0;
if(s & Button1Mask) m.buttons |= 1;
if(s & Button2Mask) m.buttons |= 2;
- if(s & Button3Mask) m.buttons |= 4;
+ if(s & Button3Mask) m.buttons |= (s & ShiftMask) ? 2 : 4;
if(s & Button4Mask) m.buttons |= 8;
f = ((GwinWidget)w)->gwin.gotmouse;
if(f)