Introduction
Introduction Statistics Contact Development Disclaimer Help
Merge pull request #65 from hubhamster/pointtotype - sam - An updated version o…
git clone git://vernunftzentrum.de/sam.git
Log
Files
Refs
LICENSE
---
commit 3184909efee9f81359fcd81a4fc4626fe8fa0c78
parent e14578ad4611d277ba702e783cc619a52c409cd3
Author: Rob King <[email protected]>
Date: Fri, 15 Sep 2017 20:38:49 -0500
Merge pull request #65 from hubhamster/pointtotype
Pointtotype
Diffstat:
doc/samrc.5 | 19 +++++++++++++++++++
samterm/main.c | 6 +++++-
samterm/menu.c | 2 ++
samterm/samrc.c | 11 +++++++++++
samterm/samterm.h | 1 +
5 files changed, 38 insertions(+), 1 deletion(-)
---
diff --git a/doc/samrc.5 b/doc/samrc.5
@@ -226,6 +226,24 @@ The forms are:
snarfselection secondary
snarfselection clipboard
.Ed
+.It followfocus
+Determines window focus mode.
+It is of the form:
+.Bd -literal
+
+ followfocus B
+
+.Ed
+where
+.Em B
+is the string
+.Dq true
+or
+.Dq false "."
+If
+.Dq true ","
+then the window focus mode is set to follow the mouse pointer.
+In this mode typing is directed to the window currently underneath the mouse p…
.El
.Ss Defaults
The default keybindings and mouse chords are those documented in
@@ -237,6 +255,7 @@ and tabstops are set at every eight characters.
The default X selection is
.Do primary
.Dc "."
+The default window focus mode is "Click to focus". Typing is directed to the w…
.Ss "Modifier Keys"
The
.Em bind
diff --git a/samterm/main.c b/samterm/main.c
@@ -31,6 +31,7 @@ bool autoindent = false;
char *machine = "localhost";
int exfd = -1;
const char *exname;
+bool followfocus = false;
void
removeext(void)
@@ -151,6 +152,8 @@ main(int argc, char *argv[])
scroll(which, 3, 3);
else
menu3hit();
+ }else if(followfocus && nwhich && nwhich!=which){
+ current(nwhich);
}
mouseunblock();
}
@@ -180,7 +183,8 @@ current(Flayer *nw)
flborder(which, false);
if(nw){
flushtyping(true);
- flupfront(nw);
+ if (!followfocus)
+ flupfront(nw);
flborder(nw, true);
buttons(Up);
t = (Text *)nw->user1;
diff --git a/samterm/menu.c b/samterm/menu.c
@@ -180,6 +180,8 @@ menu3hit(void)
i = 0;
while(i!=t->front && t->l[i].textfn==0);
current(&t->l[i]);
+ if (followfocus)
+ flupfront(&t->l[i]);
}else if(!lock)
sweeptext(0, tag[m-NMENU3]);
break;
diff --git a/samterm/samrc.c b/samterm/samrc.c
@@ -234,6 +234,16 @@ nametokeysym(const char *n)
}
static int
+dirfollowfocus(const char *s1, const char *s2, const char *s3, const char *s4,…
+{
+ if (strcasecmp(s1, "true") != 0 && strcasecmp(s1, "false") != 0)
+ return -1;
+
+ followfocus = (strcasecmp(s1, "true") == 0);
+ return 0;
+}
+
+static int
dirsnarfselection(const char *s1, const char *s2, const char *s3, const char *…
{
extern const char *clipatom;
@@ -389,6 +399,7 @@ Directive directives[] ={
{" expandtabs %99s", 1, direxpa…
{" autoindent %99s", 1, dirauto…
{" snarfselection %99s", 1, dirsnar…
+ {" followfocus %99s", 1, dirfoll…
{" %1[#]", 1, dircomm…
{" %1[^ ]", EOF, dircomm…
{NULL, 0, NULL}
diff --git a/samterm/samterm.h b/samterm/samterm.h
@@ -93,6 +93,7 @@ extern bool hasunlocked;
extern int64_t snarflen;
extern Mouse mouse;
extern bool modified;
+extern bool followfocus;
wchar_t *stgettext(Flayer*, int64_t, uint64_t*);
void *alloc(uint64_t n);
You are viewing proxied material from vernunftzentrum.de. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.