[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple bindings for the same keycode

From: Avery Pennarun
Subject: Re: Multiple bindings for the same keycode
Date: Fri, 18 Aug 2006 16:34:37 -0400

On 8/17/06, Thomas Dickey <address@hidden> wrote:
You can use define_key() with your own table to add multiple strings for a
given keycode.  That would of course rely on having the data stored
outside the terminfo.  But it wouldn't require changing the terminfo
syntax.  Alternatively, you could use ncurses' extended terminfo feature
and store extra names in the terminfo according to some naming convention.
Then (at runtime), a user-provided function could inspect the output of
keynames() and call define_key() to merge the data.

Okay, I've produced a new patch based on your suggestion.  Any
extended key named (standardname)__(suffix) will be added by
init_keytry under the (standardname) keycode instead of its extended
code.  I used double underscore since I figured that wouldn't conflict
with any "typical" extended keys that someone might want to use.

The resulting patch is simpler than my previous one.  With this patch,
it's easy to define terminfo entries that will work with "slightly
variant" terminal emulators that have differing opinions of what
delete/home/end/pgup/pgdn are supposed to be.  Do you think this patch
would be accepted into ncurses?

My next step after this would be to modify the terminfo.src to make
sure as many terminal types as possible include as many key variations
as possible.



Attachment: patch
Description: Binary data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]