Hi,

* Cameron Simpson <c...@zip.com.au> [120611 07:20]:
> ... curses delivers a bare ESC if you just tap escape, and the other
> keys send ESC-blah-blah, curses distinguishes them by the delay
> after a "real" ESC. In principle you could make your terminfo entry
> describe some unused keystroke as having the escape sequence send by
> two <right>s in succession. In this way curses might present your
> autorepeated <right>s as the other key, and only send a real <right>
> when you tap it once. [...]
>
> So maybe you could add:
>
>   kMSG=\EOC\EOC,
>
> to your terminfo (supplanting "shifted message key").

* Cameron Simpson <c...@zip.com.au> [120612 22:28]:
> On 11Jun2012 20:37, John Magolske <listm...@b79.net> wrote:
> | Interesting idea...if it did work, would it not mess up autorepeated
> | <right>s across the board?
> 
> Yep.
> 
> But you could invoke mutt via a wrapper script that went:
> 
>   TERM=$TERM-mutt mutt ${1+"$@"}
> 
> and have the "-mutt" terminfo entry be the modified one.

Ok, I gave this a try...checking to make sure my modified terminfo
is being read:
 
    % TERM=$TERM-mutt
    % echo $TERM
    screen.linux-mutt
    % infocmp $TERM | grep kMSG
            il=\E[%p1%dL, il1=\E[L, ind=^J, is2=\E)0, kMSG=\EOC\EOC,

Then launched mutt with `TERM=$TERM-mutt mutt` ...but it didn't work.
I saw the same behavior as before -- holding down <right> in the pager
zips through a rapid succession of messages.

> | The showkey command shows this when
> | pressing & releasing the <right> key:
> | 
> |     keycode 106 press
> |     keycode 106 release
> 
> Is that really nicely delayed? i.e. if you hold down <right> (not too
> long!) is the "release" really deferred until to "up".

Yes, the "release" always deferred until to "up".

> Also, if you hold it down long enough to autorepeat, do you only get the
> opening press and final release, or lots and lots of press/release
> pairs?

Pressing <right> displays a steady stream of "keycode 106 press" for
as long as the key is held down. When it is released, exactly one
"keycode 106 release" displayed.

> I'd also point out that showkey will only work on a linux console.
> It may not in an xterm, and definitely won't over a remote connection.

Wasn't thinking of using showkey per se, more just wondering if there
was any differentiation between a "press" and a "release" that could
be accessed at some level, but it doesn't look like that's doable. 

What I'm thinking would be nice is to have an option in mutt for the
"next-entry" functionality to only increment one entry per key press.
Not sure if this behavior is enough of an issue for anyone else, or
even how technically feasible it would be to implement such an option
across a range of terminals...but another area this shows up for me is
when "pager_stop" is not set. If a long message is followed by several
short messages, pressing the space bar will page quickly through the
long message (as expected & sometimes desired), then go flying through
a bunch of other messages so quickly it's not possible to identify
what they are.

Maybe this has to do with my keyboard repeat rate set to 30 characters
per second with a relatively short 250 millisecond delay...but other
than the "next-entry" issue here, it works well for me, providing a
quick & responsive ncurses experience. Anyhow, it's not a huge deal,
overall I'm pretty happy with the mutt user experience, just checking
to see what's possible.

Thanks for the suggestions Cameron, now I now more about how to tweak
my terminal behavior with custom a terminfo.

Regards,

John

-- 
John Magolske
http://B79.net/contact

Reply via email to