[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: I don't understand ncurses dealing with control-ARROW
From: |
Steffen Nurpmeso |
Subject: |
Re: I don't understand ncurses dealing with control-ARROW |
Date: |
Mon, 21 Dec 2015 12:24:04 +0100 |
User-agent: |
s-nail v14.8.5-206-gfc8f312-dirty |
Hello and good morning,
Thomas Dickey <address@hidden> wrote:
|On Thu, Dec 17, 2015 at 10:52:38PM +0100, Steffen Nurpmeso wrote:
|> I'm currently rewriting some code that deals with termcap (being
|> out of the question before) and don't actually understand how to
|> get at the control-ARROW etc. modifiers.
|> nsterm, yet TERM=screen.xterm-256color (over ssh) and infocmp(1)
|> doesn't output anything for kLFT5. How do you do that? ..Is this
|> interpolated given that kLFT=\E[1;2D for both? (..Likely..)
|
|no, it's not interpolated, but all explicit. You have to add the "-x"
|option of infocmp to see the extended/user-defined capabilities.
Oh. Indeed, that shows them. Fyi please note that i would not
have expected anything neither under user-defined nor under "treat
unknown as user-defined" (what tic says for -x). I.e., isn't that
a regular entry? And: which standard do i have to read to be able
to be enabled to tell so by myself? (Maybe rethorical question :)
|Comparing the output of these (nsterm with/without "-x"):
...
|> My question is why this is kLFT5 given that Caps.keys says the
|> capname will be kclft? Also, for kclft there is a %k termcap
|> mapping, but i couldn't find any hint on such a thing for kLFT5.
|
|oh... I'd have to say that Caps.keys was experimental
|
|20010804 \
|
| + add Caps.keys example for experimental extended function keys
| (adapted from a patch by Ilya Zakharevich).
Ah.
|but that I did not take it into account when adding the xterm function
|keys because (besides not thinking about it), there are many more
|combinations of modifiers in xterm than the enumeration in Caps.keys
|would handle.
Hm. Then again not that much more (enough for __me__!!!!!). But
of course you are right, you have to give a name to an entire
combination and that will lead you to nowhere.
|Caps.keys is an example (like the other Caps.* files) which ncurses
|could be compiled with, but I don't recall anyone actually using it.
Oh. Well. My way lead me over termcap(5) and terminfo(5) over
a remembered thread on the rxvt-unicode ML to several therein
referenced pages, one of which lead to the file Caps.keys, another
to your home page and the modifier table example for the delete
character function -- i think it was? dc? (Odysseus' was more
dangerous, but at least there were women along the way, hahaha..)
|> For me the worst is that i cannot give end-users just any hint on
|> how to get at the actual name nor sequence, except by copy+pasting
|> a small C program that queries kLFT5++ and returns what is true as
|> opposed to what infocmp says for $TERM. I'm thinking about
|> deliberately violating ncurses (?) by using tigetstr() in
|> conjunction with tgetent() when it is available.
|
|I recommend using tigetstr, since tgetstr (termcap) won't handle the
|longer names.
It would work. Good to know. I've added a note to the manual
that "$ cat" should be used and explained what escape is and how
to define a control character, and gave an example
set termcap="%k=\033[D,%o=\033[C,%q=\033[A,%r=\033[B"
But if tigetstr() works even if i otherwise only use the old-style
termcap approach then i think i will extend the code again and use
it if available; since these are rather exotic functions the user
will have to manually adjust in other environments, which i hope
the manual will enable her to.
Thanks! And ciao (and a merry Christmas, too),
--steffen