st-scrollback-mouse-altscreen-20170427-5a10aca.diff - sites - public wiki contents of suckless.org
 (HTM) git clone git://git.suckless.org/sites
 (DIR) Log
 (DIR) Files
 (DIR) Refs
       ---
       st-scrollback-mouse-altscreen-20170427-5a10aca.diff (1228B)
       ---
            1 diff --git a/config.def.h b/config.def.h
            2 index a9c65a9..b709419 100644
            3 --- a/config.def.h
            4 +++ b/config.def.h
            5 @@ -162,8 +162,8 @@ MouseShortcut mshortcuts[] = {
            6  
            7  MouseKey mkeys[] = {
            8          /* button               mask            function        argument */
            9 -        { Button4,              ShiftMask,      kscrollup,      {.i =  1} },
           10 -        { Button5,              ShiftMask,      kscrolldown,    {.i =  1} },
           11 +        { Button4,              XK_NO_MOD,      kscrollup,      {.i =  1} },
           12 +        { Button5,              XK_NO_MOD,      kscrolldown,    {.i =  1} },
           13  };
           14  
           15  /* Internal keyboard shortcuts. */
           16 diff --git a/x.c b/x.c
           17 index 67dcfdc..45af5f2 100644
           18 --- a/x.c
           19 +++ b/x.c
           20 @@ -255,13 +255,14 @@ bpress(XEvent *e)
           21                  return;
           22          }
           23  
           24 -        for (ms = mshortcuts; ms < mshortcuts + mshortcutslen; ms++) {
           25 -                if (e->xbutton.button == ms->b
           26 -                                && match(ms->mask, e->xbutton.state)) {
           27 -                        ttysend(ms->s, strlen(ms->s));
           28 -                        return;
           29 +        if (IS_SET(MODE_ALTSCREEN))
           30 +                for (ms = mshortcuts; ms < mshortcuts + mshortcutslen; ms++) {
           31 +                        if (e->xbutton.button == ms->b
           32 +                                        && match(ms->mask, e->xbutton.state)) {
           33 +                                ttysend(ms->s, strlen(ms->s));
           34 +                                return;
           35 +                        }
           36                  }
           37 -        }
           38  
           39          for (mk = mkeys; mk < mkeys + mkeyslen; mk++) {
           40                  if (e->xbutton.button == mk->b