Re: [hackers] [st] Mouse buttons binding

From: Alexander Rezinsky <alexrez_AT_gmail.com>
Date: Sun, 28 Apr 2013 08:19:49 -0700

Hi Christoph,

Right now st doesn't implements scrolling, so it has nothing to do with
mouse Button4/Button5 events. On the other hand, it will be very useful to
scroll terminal contents with mouse wheel using some terminal multiplexer
like Gnu screen or tmux.

My patch adds such ability to Gnu Screen. Mouse wheel events passed to Gnu
screen as its escape sequences for terminal content scrolling. SCREEN_ESC
is gnu screens special character (C-a by default) to enter command mode.
Its better to define it separate because some people prefer to redefine it
in Gnu-screen itself using ~/.screenrs file

For example for tmux the table will looks something like:

#define SCR_ESC "\002"

static MouseB mouseb[] = {
    { Button4, ShiftMask, SCR_ESC "[\015" },
    { Button4, ControlMask, SCR_ESC "[\015\015" },
    { Button4, XK_ANY_MOD, SCR_ESC "[\015\015" },
    { Button5, ShiftMask, SCR_ESC "[\004" },
    { Button5, ControlMask, SCR_ESC "[\004\004" },
    { Button5, XK_ANY_MOD, SCR_ESC "[\004\004" },
};

----
Regards,
Alexander Rezinsky
On Sat, Apr 27, 2013 at 11:47 PM, Christoph Lohmann <20h_AT_r-36.net> wrote:
> Greetings.
>
> On Sun, 28 Apr 2013 08:47:08 +0200 Alexander Rezinsky <alexrez_AT_gmail.com>
> wrote:
> > diff --git a/config.def.h b/config.def.h
> > index b44fe17..a35aaa9 100644
> > --- a/config.def.h
> > +++ b/config.def.h
> > _AT__AT_ -322,6 +322,19 @@ static Key key[] = {
> >  };
> >
> >  /*
> > + * Special mouse buttons
> > + */
> > +#define SCREEN_ESC "\001"
> > +
> > +static MouseB mouseb[] = {
> > +    { Button4,  ShiftMask,   SCREEN_ESC "\0331\025"  },
> > +    { Button4,  ControlMask, SCREEN_ESC "\033\002"   },
> > +    { Button4,  XK_ANY_MOD,  SCREEN_ESC "\03320\025" },
> > +    { Button5,  ShiftMask,   SCREEN_ESC "\0331\004"  },
> > +    { Button5,  ControlMask, SCREEN_ESC "\033\006"   },
> > +    { Button5,  XK_ANY_MOD,  SCREEN_ESC "\03320\004" },
> > +};
>
> Your  patch  is  changing  the current meaning of the mouse wheel up and
> down.  Where did you get that escape codes from  and  which  application
> does need such masked button events?
>
> What’s  SCREEN_ESC?  Where did you get that value from? Why does it need
> to be defined separately?
>
> Why  do you handle mouse shortcuts before mousereport? Then the applica‐
> tion is meant to handle all mosue events. Is this needed in your case?
>
>
> Sincerely,
>
> Christoph Lohmann
>
>
Received on Sun Apr 28 2013 - 17:19:49 CEST

This archive was generated by hypermail 2.3.0 : Sun Apr 28 2013 - 17:24:09 CEST