Re: [code] [textadept] Key mapping in command_entry

From: Mitchell <m.att.foicica.com>
Date: Wed, 11 Sep 2013 12:04:01 -0400 (Eastern Daylight Time)

Chris,

On Tue, 10 Sep 2013, Chris Emerson wrote:

> Hi Mitchell,
>
> On Thu, Aug 29, 2013 at 11:58:00AM -0400, Mitchell wrote:
>> Well there's the termkey translation and then the raw
>> curses/pdcurses translation (because CDK calls `c_keypress()`;
>> termkey is not used). The pdcurses translation could be put into a
>> separate function, but I'd have to write a new one for regular
>> curses. I'll look into it and get back to you. Perhaps it's not as
>> bad as I thought.
>
> I've been thinking about this key input/translation thing.
>
> Another annoyance I've noticed is that I think keys can get lost when
> swapping between normal input and command_entry. For example, I have ':'
> mapped to start a command_entry mode - if I type the sequence ':b foo' too
> quickly, the 'b foo' won't end up in the command_entry. I think the same
> happens on the way out. I can reproduce this easily by pasting a string in,
> but it happens fairly regularly with my normal typing too, causing me to have
> to break my frenzied flow to backspace and start again more slowly.
>
> Anyway, I think (I haven't proved it, but it seems plausible and likely) that
> this is due to termkey and the curses input (used by CDKEntry) having separate
> input buffers. So in the example above, termkey's read the whole ':b foo'
> sequence (or in real life, maybe ':b f') from stdin, so curses never sees it.
> So my conclusion is that both textadept's main loop and the CDKEntry need to
> have common key input.
>
> On a related subject, I'm trying out switching from termkey_waitkey() in the
> main loop to a combination of select()/termkey_advisereadable()/
> termkey_getkey(). The advantage being that it then becomes possible to add
> functionality similar to lspawn (and _G.timeout()) in curses! Which means I
> probably want to modify CDK to get its input the same way rather than calling
> wgetch(), and having the translation happen separately.

That makes a lot of sense and I think you're on to something. It would be
nice to have all input go through libtermkey so I'm eager to see what you
come up with :)

Cheers,
Mitchell

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Wed 11 Sep 2013 - 12:04:01 EDT

This archive was generated by hypermail 2.2.0 : Thu 12 Sep 2013 - 06:43:04 EDT