summaryrefslogtreecommitdiff
path: root/sys/src/cmd/acme
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2020-08-03 21:52:22 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2020-08-03 21:52:22 +0200
commitc4cf92b99efdf292e0563fedda68f650cb9970d6 (patch)
tree9994cf454d271cba863c828c4b45078d50b6ecc9 /sys/src/cmd/acme
parentcbe45e78f988184938ab63f8bac28632058e5810 (diff)
parent053a6526e28c9676c4c677e9d2bb654b0352d3a8 (diff)
merge
Diffstat (limited to 'sys/src/cmd/acme')
-rw-r--r--sys/src/cmd/acme/acme.c19
-rw-r--r--sys/src/cmd/acme/scrl.c4
2 files changed, 15 insertions, 8 deletions
diff --git a/sys/src/cmd/acme/acme.c b/sys/src/cmd/acme/acme.c
index 96a7d6b03..e874d3554 100644
--- a/sys/src/cmd/acme/acme.c
+++ b/sys/src/cmd/acme/acme.c
@@ -513,13 +513,8 @@ mousethread(void *)
but = 2;
else if(m.buttons == 4)
but = 3;
- else if(m.buttons == 8)
- but = 4;
- else if(m.buttons == 16)
- but = 5;
barttext = t;
- if(t->what==Body && w != nil
- && (ptinrect(m.xy, t->scrollr) || (m.buttons & (8|16)))){
+ if(t->what==Body && ptinrect(m.xy, t->scrollr)){
if(but){
winlock(w, 'M');
t->eq0 = ~0;
@@ -528,6 +523,18 @@ mousethread(void *)
}
goto Continue;
}
+ /* scroll buttons, wheels, etc. */
+ if(t->what==Body && w != nil && (m.buttons & (8|16))){
+ if(m.buttons & 8)
+ but = Kscrolloneup;
+ else
+ but = Kscrollonedown;
+ winlock(w, 'M');
+ t->eq0 = ~0;
+ texttype(t, but);
+ winunlock(w);
+ goto Continue;
+ }
if(ptinrect(m.xy, t->scrollr)){
if(but){
if(t->what == Columntag)
diff --git a/sys/src/cmd/acme/scrl.c b/sys/src/cmd/acme/scrl.c
index 0d4173968..1310bc763 100644
--- a/sys/src/cmd/acme/scrl.c
+++ b/sys/src/cmd/acme/scrl.c
@@ -132,7 +132,7 @@ textscroll(Text *t, int but)
readmouse(mousectl);
continue;
}
- if(but == 1 || but == 4)
+ if(but == 1)
p0 = textbacknl(t, t->org, (my-s.min.y)/t->font->height);
else
p0 = t->org+frcharofpt(t, Pt(s.max.x, my));
@@ -140,7 +140,7 @@ textscroll(Text *t, int but)
textsetorigin(t, p0, TRUE);
oldp0 = p0;
/* debounce */
- if(first && but < 4){
+ if(first){
flushimage(display, 1);
sleep(200);
nbrecv(mousectl->c, &mousectl->Mouse);