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

From: Chris Emerson <c-ta.att.mail.nosreme.org>
Date: Thu, 29 Aug 2013 16:42:44 +0100

Hi Mitchell,

On Thu, Aug 29, 2013 at 09:49:42AM -0400, Mitchell wrote:
> You will see in src/textadept.c's `main()` function you will see how
> keys are handled in the main view (not the command entry). There are
> tables and complicated "if" statements. All of that results in
> sending the proper SCK_* keys that are in core/keys.lua's `KEYSYMS`
> table.

Right, I see. Some of it goes via termkey.

> Now look at src/textadept.c's `c_keypress()` function in the CURSES
> #ifdef (around line 547). There is very little interpretation of
> curses/pdcurses keys. In short, I've neglected the command entry. I
> don't remember if this was to save lines of C, if I didn't think
> handling KEY_UP, KEY_DOWN, and the like was useful (perhaps I
> thought ^A-^Z was good enough), or both. (It was probably both.)
>
> I'm kind of torn on this one, to be honest.

Any reason not to factor the translation into a separate function to be called
from both places? (Other than the time and effort)

Regards,

Chris

-- 
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 Thu 29 Aug 2013 - 11:42:44 EDT

This archive was generated by hypermail 2.2.0 : Fri 30 Aug 2013 - 06:35:38 EDT