On Fri, Apr 18, 2008 at 10:48:48AM -0700, Gary Johnson wrote:
> I believe the idea of terminfo is to have symbols for keys' 
> functions, not how you pressed them, i.e., to separate function from 
> mechanism.  Type the ; key, getch() returns ';'.  Hold the Shift key 
> and type the ; key, getch() returns ':' (on my keyboard), not some 
> code for Shift-;.

Sure. That's for real character input. ; is a printing character.

What about the up arrow?

The idea of terminfo may be to represent abstracted key functions, but
that doesn't seem to be the way people are heading now. GTK, X11,
XTerm's new CSIs, .. the way Vim itself tries to :map keys. These all
want to work by a {set of modifiers + base key} concept. Yes, I'm
willing to accept that : is just Shift-;. Shift it simply the mechanism
used to obtain the :. But what of Up arrow. Shift-Up. Ctrl-Up.
Alt-Hyper-Ctrl-Up. ?

> > Furthermore, explain where in termcap/terminfo I can find any hint of
> > knowledge about modifiers?
> 
> Again, I believe the absence of knowledge about modifiers is by 
> design.  The application should care only about the key's function, 
> not what the user had to do on any particular keyboard to get that 
> function.

Again... Note the way that everyone seems to want these modifiers.

Terminfo's way of abstracting that out into a flat list of symbols may
have made a lot of sense some time ago. But this is now, not then. We do
have real Ctrl / Alt / Hyper / Super keys. People do seem to want
modified function keys. I'm simply trying to provide them what they
want, rather than tell them they shouldn't want it.

> Terminfo/curses presents a higher-level abstraction of a keyboard 
> than your library does.  That abstraction has some limits.  Your 
> abstraction has benefits and costs, which are certainly worth 
> discussing.  For the present, I just wanted to correct the notion 
> that terminfo/curses doesn't handle keyboard input well.

OK. Then perhaps I'll change my wording.

terminfo/curses doesn't handle the sort of keyboard input that I and a
lot of other people seem to want. Something has to budge. Either Vim
needs to be able to handle those, or we as users need to be told "No,
you don't want Shift-Up. That's a stupid thing to want."

-- 
Paul "LeoNerd" Evans

[EMAIL PROTECTED]
ICQ# 4135350       |  Registered Linux# 179460
http://www.leonerd.org.uk/

Attachment: signature.asc
Description: Digital signature

Raspunde prin e-mail lui