bug-ncurses
[Top][All Lists]
Advanced

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

Re: Multiple bindings for the same keycode


From: Thomas Dickey
Subject: Re: Multiple bindings for the same keycode
Date: Thu, 17 Aug 2006 19:19:00 -0400 (EDT)

On Thu, 17 Aug 2006, Avery Pennarun wrote:

I might send a message about the first issue another time, as I think
I might have found a bug in ncurses 5.5 if you disable all of cub1,
cuf1, cuu1, cud1 from a terminfo entry and leave only cup: cursor
positioning doesn't quite work reliably in that case, even in a
sensble terminal like xterm or rxvt.  However, I don't have a simple
test case for this yet so you might find it hard to debug.

...to do list...

Meanwhile, I need some advice on how to implement my second problem
relating to keycodes.  My initial implementation looked something like
this:

- split keycode strings on the string "!!" and call _nc_add_to_try
once per portion of the split string
- modify tic and infocmp to parse/dump a file with more than one
"khome" (say) and produce an output file with a single entry separated
by "!!".

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.

This actually works really nicely for most apps, and I was happy with
the results.  Unfortunately, it seems that some apps try to do more of
the work themselves, and ask for the actual key string from ncurses...
and this includes the "!!" and extra crud, so such apps don't work
right at all.

yes...

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net




reply via email to

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