Re: Keychains

From: mitchell <mforal.n....at.gmail.com>
Date: Sun, 11 Apr 2010 09:26:02 -0700 (PDT)

Robert,

On Apr 11, 12:05 pm, Robert <ro....at.web.de> wrote:
> On Apr 10, 5:18 pm, mitchell <mforal.n....at.gmail.com> wrote:
>
>
>
> > Robert,
>
> > On Apr 10, 8:23 am, Robert <ro....at.web.de> wrote:
>
> > > Hi!
>
> > > Is it possible to have keychains behave like the other modifier keys?
> > > E.g. with
> > > keys.cf = keys.cf   = { 'char_right', b }
> > > I can keep ctrl pressed and I can press "f" many times to move the
> > > caret one char forward.
>
> > > I would like to have something like
> > > keys.ar = {
> > >    f = { 'char_right_rect_extend', b },
> > >    b = { 'char_left_rect_extend',  b },
> > >    n = { 'line_down_rect_extend',  b },
> > >    p = { 'line_up_rect_extend',    b },
> > >    a = { 'vc_home_rect_extend',    b },
> > >   e = { 'line_end_rect_extend',   b },}
>
> > > So, press alt and r, then hold down alt and press "f", "n", etc. to
> > > make my rectangular selection.
>
> > > Is this possible? Currently, I would have to press alt+r, pause, then
> > > f and then repeat the complete keychain.
>
> > I don't think this is possible. Maybe playing around in core/ext/
> > keys.lua will get you somewhere, but I cannot think how.
>
> > Mitchell
>
> I looked there, but would agree... Would it be possible to have a
> function that would listen to all keypress events (overriding the
> default keypress event listener), do some rect_extend for f, b, n, p
> or the arrow keys and return when any other key is pressed? I tried
> but it wasn't really succesful.

You could try textadept.events.add_handler('keypress', your_func, 1).
I'm not exactly sure if that's what you're looking for, but it will be
run before the standard key handler.

Mitchell

>
> Robert
Received on Sun 11 Apr 2010 - 12:26:02 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:43:15 EST