diff options
author | rsc <devnull@localhost> | 2005-01-10 00:21:13 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-01-10 00:21:13 +0000 |
commit | d8c78a8d560420c0f3996ed264098c6d26a27ac5 (patch) | |
tree | f1d8859d9be896d03f8816363152c71f30dcb440 | |
parent | 5eead98e71ca5d7df5797fc04371848e6ae04f4f (diff) | |
download | plan9port-d8c78a8d560420c0f3996ed264098c6d26a27ac5.tar.gz plan9port-d8c78a8d560420c0f3996ed264098c6d26a27ac5.tar.bz2 plan9port-d8c78a8d560420c0f3996ed264098c6d26a27ac5.zip |
add -r flag to reverse scrolling behavior.
from peter canning.
-rw-r--r-- | src/cmd/acme/acme.c | 10 | ||||
-rw-r--r-- | src/cmd/acme/dat.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/cmd/acme/acme.c b/src/cmd/acme/acme.c index 111b9a99..c3b0fbac 100644 --- a/src/cmd/acme/acme.c +++ b/src/cmd/acme/acme.c @@ -27,6 +27,7 @@ char wdir[512] = "."; Reffont *reffonts[2]; int snarffd = -1; int mainpid; +int swapscrollbuttons = FALSE; enum{ NSnarf = 1000 /* less than 1024, I/O buffer size */ @@ -102,6 +103,9 @@ threadmain(int argc, char *argv[]) if(loadfile == nil) goto Usage; break; + case 'r': + swapscrollbuttons = TRUE; + break; case 'W': winsize = ARGF(); if(winsize == nil) @@ -562,6 +566,12 @@ mousethread(void *v) barttext = t; if(t->what==Body && ptinrect(m.xy, t->scrollr)){ if(but){ + if(swapscrollbuttons){ + if(but == 1) + but = 3; + else if(but == 3) + but = 1; + } winlock(w, 'M'); t->eq0 = ~0; textscroll(t, but); diff --git a/src/cmd/acme/dat.h b/src/cmd/acme/dat.h index 9db71286..97953325 100644 --- a/src/cmd/acme/dat.h +++ b/src/cmd/acme/dat.h @@ -515,6 +515,7 @@ Text *mousetext; /* global because Text.close needs to clear it */ Text *typetext; /* global because Text.close needs to clear it */ Text *barttext; /* shared between mousetask and keyboardthread */ int bartflag; +int swapscrollbuttons; Window *activewin; Column *activecol; Buffer snarfbuf; |