tButtons 4 and 5. - plan9port - [fork] Plan 9 from user space
 (HTM) git clone git://src.adamsgaard.dk/plan9port
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit c16f1f733b5748211db515fa19dd821065fd6fc7
 (DIR) parent ff8bbc7987bd23cffd029d5968e76dbdeb67c7fa
 (HTM) Author: rsc <devnull@localhost>
       Date:   Wed,  9 Jun 2004 14:01:43 +0000
       
       Buttons 4 and 5.
       
       Diffstat:
         M src/cmd/acme/acme.c                 |      12 ++++++++++++
         M src/cmd/acme/dat.h                  |       7 ++++++-
         M src/cmd/acme/text.c                 |       8 ++++++--
       
       3 files changed, 24 insertions(+), 3 deletions(-)
       ---
 (DIR) diff --git a/src/cmd/acme/acme.c b/src/cmd/acme/acme.c
       t@@ -536,6 +536,18 @@ mousethread(void *v)
                                        }
                                        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)
 (DIR) diff --git a/src/cmd/acme/dat.h b/src/cmd/acme/dat.h
       t@@ -529,7 +529,12 @@ int                        editing;
        int                        erroutfd;
        int                        messagesize;                /* negotiated in 9P version setup */
        int                        globalautoindent;
       -int                        nodotfiles;
       +
       +enum
       +{
       +        Kscrolloneup                = KF|0x20,
       +        Kscrollonedown        = KF|0x21,
       +};
        
        Channel        *ckeyboard;        /* chan(Rune)[10] */
        Channel        *cplumb;                /* chan(Plumbmsg*) */
 (DIR) diff --git a/src/cmd/acme/text.c b/src/cmd/acme/text.c
       t@@ -224,8 +224,6 @@ textload(Text *t, uint q0, char *file, int setqid)
                        dbuf = nil;
                        while((n=dirread(fd, &dbuf)) > 0){
                                for(i=0; i<n; i++){
       -                                if(nodotfiles && dbuf[i].name[0] == '.')
       -                                        continue;
                                        dl = emalloc(sizeof(Dirlist));
                                        j = strlen(dbuf[i].name);
                                        tmp = emalloc(j+1+1);
       t@@ -660,6 +658,9 @@ texttype(Text *t, Rune r)
                case Kdown:
                        n = t->fr.maxlines/3;
                        goto case_Down;
       +        case Kscrollonedown:
       +                n = 1;
       +                goto case_Down;
                case Kpgdown:
                        n = 2*t->fr.maxlines/3;
                case_Down:
       t@@ -669,6 +670,9 @@ texttype(Text *t, Rune r)
                case Kup:
                        n = t->fr.maxlines/3;
                        goto case_Up;
       +        case Kscrolloneup:
       +                n = 2;        /* feels like this should be n=1, but that does nothing */
       +                goto case_Up;
                case Kpgup:
                        n = 2*t->fr.maxlines/3;
                case_Up: