Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Semper Fi, dude.


devel / comp.lang.c++ / Re: Parsing multi-byte keystrokes

SubjectAuthor
* Parsing multi-byte keystrokesR.Wieser
+* Re: Parsing multi-byte keystrokesAlf P. Steinbach
|+- Re: Parsing multi-byte keystrokesR.Wieser
|`* Re: Parsing multi-byte keystrokesKeith Thompson
| +* Re: Parsing multi-byte keystrokesPavel
| |`- Re: Parsing multi-byte keystrokesKeith Thompson
| `- Re: Parsing multi-byte keystrokesR.Wieser
+* Re: Parsing multi-byte keystrokesPavel
|+* Re: Parsing multi-byte keystrokesBen Bacarisse
||`* Re: Parsing multi-byte keystrokesR.Wieser
|| +- Re: Parsing multi-byte keystrokesChristian Gollwitzer
|| `* Re: Parsing multi-byte keystrokesBen Bacarisse
||  `* Re: Parsing multi-byte keystrokesR.Wieser
||   `* Re: Parsing multi-byte keystrokesChristian Gollwitzer
||    `* Re: Parsing multi-byte keystrokesR.Wieser
||     +- Re: Parsing multi-byte keystrokesKeith Thompson
||     `* Re: Parsing multi-byte keystrokesChristian Gollwitzer
||      `- Re: Parsing multi-byte keystrokesKeith Thompson
|`* Re: Parsing multi-byte keystrokesR.Wieser
| +* Re: Parsing multi-byte keystrokesKeith Thompson
| |`* Re: Parsing multi-byte keystrokesR.Wieser
| | +* Re: Parsing multi-byte keystrokesMuttley
| | |`- Re: Parsing multi-byte keystrokesR.Wieser
| | `* Re: Parsing multi-byte keystrokesKeith Thompson
| |  `* Re: Parsing multi-byte keystrokesR.Wieser
| |   +- Re: Parsing multi-byte keystrokesKeith Thompson
| |   `* Re: Parsing multi-byte keystrokesScott Lurndal
| |    `- Re: Parsing multi-byte keystrokesR.Wieser
| +* Re: Parsing multi-byte keystrokesScott Lurndal
| |+- Re: Parsing multi-byte keystrokesR.Wieser
| |`- Re: Parsing multi-byte keystrokesKeith Thompson
| +* Re: Parsing multi-byte keystrokesred floyd
| |`* Re: Parsing multi-byte keystrokesKenny McCormack
| | `* Re: Parsing multi-byte keystrokesScott Lurndal
| |  `* Re: Parsing multi-byte keystrokesR.Wieser
| |   `* Re: Parsing multi-byte keystrokesKenny McCormack
| |    `* Re: Parsing multi-byte keystrokesR.Wieser
| |     +* Re: Parsing multi-byte keystrokesBen Bacarisse
| |     |`* Re: Parsing multi-byte keystrokesR.Wieser
| |     | +* Re: Parsing multi-byte keystrokesScott Lurndal
| |     | |`- Re: Parsing multi-byte keystrokesR.Wieser
| |     | +* Re: Parsing multi-byte keystrokesPaavo Helde
| |     | |`- Re: Parsing multi-byte keystrokesR.Wieser
| |     | +- Re: Parsing multi-byte keystrokesBen Bacarisse
| |     | +* Re: Parsing multi-byte keystrokesKeith Thompson
| |     | |`* Re: Parsing multi-byte keystrokesR.Wieser
| |     | | `* Re: Parsing multi-byte keystrokesKeith Thompson
| |     | |  `* Re: Parsing multi-byte keystrokesR.Wieser
| |     | |   +* Re: Parsing multi-byte keystrokesChristian Gollwitzer
| |     | |   |`- Re: Parsing multi-byte keystrokesR.Wieser
| |     | |   +* Re: Parsing multi-byte keystrokesKeith Thompson
| |     | |   |`* Re: Parsing multi-byte keystrokesR.Wieser
| |     | |   | +- Re: Parsing multi-byte keystrokesScott Lurndal
| |     | |   | `- Re: Parsing multi-byte keystrokesJames Kuyper
| |     | |   `* Re: Parsing multi-byte keystrokesMuttley
| |     | |    `* Re: Parsing multi-byte keystrokesR.Wieser
| |     | |     +- Re: Parsing multi-byte keystrokesKenny McCormack
| |     | |     +* Re: Parsing multi-byte keystrokesJames Kuyper
| |     | |     |`* Re: Parsing multi-byte keystrokesScott Lurndal
| |     | |     | `* Re: Parsing multi-byte keystrokesJames Kuyper
| |     | |     |  `* Re: Parsing multi-byte keystrokesKalevi Kolttonen
| |     | |     |   +* Re: Parsing multi-byte keystrokesKeith Thompson
| |     | |     |   |`* Re: Parsing multi-byte keystrokesKalevi Kolttonen
| |     | |     |   | `- Re: Parsing multi-byte keystrokesScott Lurndal
| |     | |     |   `- Re: Parsing multi-byte keystrokesScott Lurndal
| |     | |     `* Re: Parsing multi-byte keystrokesMuttley
| |     | |      +* Re: Parsing multi-byte keystrokesDavid Brown
| |     | |      |+* Re: Parsing multi-byte keystrokesKalevi Kolttonen
| |     | |      ||+* Re: Parsing multi-byte keystrokesKenny McCormack
| |     | |      |||`- Re: Parsing multi-byte keystrokesKalevi Kolttonen
| |     | |      ||`* Re: Parsing multi-byte keystrokesDavid Brown
| |     | |      || +- Re: Parsing multi-byte keystrokesScott Lurndal
| |     | |      || +* Re: Parsing multi-byte keystrokesChris M. Thomasson
| |     | |      || |`- Re: Parsing multi-byte keystrokesScott Lurndal
| |     | |      || `- Re: Parsing multi-byte keystrokesKalevi Kolttonen
| |     | |      |`- Re: Parsing multi-byte keystrokesMuttley
| |     | |      `* Re: Parsing multi-byte keystrokesred floyd
| |     | |       +- Cars (Was: Parsing what is Linux?)Kenny McCormack
| |     | |       `* Re: Parsing multi-byte keystrokesMuttley
| |     | |        `* Cars (Was: Parsing multi-byte keystrokes)Kenny McCormack
| |     | |         `* Re: Cars (Was: Parsing multi-byte keystrokes)Muttley
| |     | |          `* Totally insane (Was: Cars (Was: Parsing multi-byte keystrokes))Kenny McCormack
| |     | |           `- Re: Totally insane (Was: Cars (Was: Parsing multi-byte keystrokes))Muttley
| |     | `* Re: Parsing multi-byte keystrokesJames Kuyper
| |     |  +- Re: Parsing multi-byte keystrokesKenny McCormack
| |     |  +* Re: Parsing multi-byte keystrokesR.Wieser
| |     |  |+* Re: Parsing multi-byte keystrokesJames Kuyper
| |     |  ||`* Re: Parsing multi-byte keystrokesR.Wieser
| |     |  || `* Re: Parsing multi-byte keystrokesJames Kuyper
| |     |  ||  `* Re: Parsing multi-byte keystrokesR.Wieser
| |     |  ||   `* Re: Parsing multi-byte keystrokesJames Kuyper
| |     |  ||    `* Re: Parsing multi-byte keystrokesR.Wieser
| |     |  ||     +- Re: Parsing multi-byte keystrokesScott Lurndal
| |     |  ||     `* Re: Parsing multi-byte keystrokesJames Kuyper
| |     |  ||      +* Re: Parsing multi-byte keystrokesRichard Harnden
| |     |  ||      |`- Re: Parsing multi-byte keystrokesKeith Thompson
| |     |  ||      +* Re: Parsing multi-byte keystrokesR.Wieser
| |     |  ||      |`- Re: Parsing multi-byte keystrokesJames Kuyper
| |     |  ||      `- Re: Parsing multi-byte keystrokesKeith Thompson
| |     |  |`* Re: Parsing multi-byte keystrokesDavid Brown
| |     |  | `* Re: Parsing multi-byte keystrokesR.Wieser
| |     |  `* Re: Parsing multi-byte keystrokesMalcolm McLean
| |     `* Re: Parsing multi-byte keystrokesAlf P. Steinbach
| `* Re: Parsing multi-byte keystrokesPavel
+* Re: Parsing multi-byte keystrokesScott Lurndal
`* Re: Parsing multi-byte keystrokeswij

Pages:123456
Re: Parsing multi-byte keystrokes

<87y1k60vy0.fsf@bsb.me.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=521&group=comp.lang.c%2B%2B#521

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c++
Subject: Re: Parsing multi-byte keystrokes
Date: Mon, 26 Jun 2023 22:12:38 +0100
Organization: A noiseless patient Spider
Lines: 71
Message-ID: <87y1k60vy0.fsf@bsb.me.uk>
References: <u79ug0$i1ks$1@dont-email.me> <lZ3mM.83590$8uge.57668@fx14.iad>
<u7bee1$sht9$3@dont-email.me> <xTgmM.111041$WpOe.4201@fx18.iad>
<u7cd2f$108ec$1@dont-email.me> <874jmu2lbn.fsf@bsb.me.uk>
<u7colu$122dt$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="30bd7937b87860f973277a7390f3a6b0";
logging-data="1147338"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18G/v8+dHXQRe64BXKvwG6SNPVbOReqySg="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:WmOZYASg9nLXHyLSJJ08QBtf7Fk=
sha1:pUwfwChyu9C145svxrqNs8JqlwY=
X-BSB-Auth: 1.f46d13d4c6354f524918.20230626221239BST.87y1k60vy0.fsf@bsb.me.uk
 by: Ben Bacarisse - Mon, 26 Jun 2023 21:12 UTC

"R.Wieser" <address@is.invalid> writes:

> Ben,
>
>>>> There is no way to transmit keystroke metadata over a serial line
>>>> generally,
>>>
>>> Bullshit.
>>
>> Rather than jump to this sort of conclusion, why not ask about what
>> Scott said?
>
> Because I'm getting tired of people who say one thing, but (bloody likely)
> mean something *completely* different. And I mean *completely*.
>
> I could ask him. I could even tell him what he (likely) tried to say
> instead.

I thought it was quote clear. Oh well...

> But no. It would be me fighting to get him to say what he actually means,
> and I do not care for yet another struggle like that *at all*.
>
>> By "keystroke metadata" I presume Scott means things like "left shift
>> key down" or, more likely, "key F12 while shift and control down"
>> won't get sent.
>
> Yeah, I figured that its /possible/ that that is what he ment.

I can't imagine what else you could think. My more general point is
that it's often worth taking a moment to see whether what was said
makes sense. It's rare the sane people (you have know that Scott is not
a crank) rarely post bullshit.

> But if that is actually what he ment (our guesswork!) than you get the
> next problem : By whom/what ?

It's my turn to ask. I don't know what you mean here, though it's
possible I answer your question below.

> How many terminal programs does he know of and has checked for that
> behaviour ? how many *doesn't* he know and might do just that (absense of
> proof is not proof of absense) ? In that regard his reply is *way* to
> absolute for its own good.

He's explaining why many libraries (like curses) can't tell you about
keys like Alt, Ctrl and so on. They date from an era when terminals
were connected to systems by serial lines, and the system would only
ever get the data the terminal sends.

Personal workstations (that gave rise to X11) and PCs changed all that.
If there was only one keyboard, the programmer should get access to all
the details of key codes and key press/release events.

>> Thus historical terminal interfaces would assume that only the
>> processed character sequence generated by the terminal hardware
>> can be handled.
>
> Disagree. It will, rather likely, make sure that unknown sequences are
> silently discarded - leaving it up to newer parsers to handle the extra,
> newer keys too.

I think you've missed the point. Serial lines were often used to
connect terminals that simply didn't report the metadata. They just
sent character sequences. A VT220 simply does not send anything down
the line when the operator presses the control key, but if they hit the
'A' key with control down, the terminal sends the bit pattern with value
1.

--
Ben.

Re: Parsing multi-byte keystrokes

<87fs6dzzzv.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=522&group=comp.lang.c%2B%2B#522

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c++
Subject: Re: Parsing multi-byte keystrokes
Date: Mon, 26 Jun 2023 14:15:48 -0700
Organization: None to speak of
Lines: 36
Message-ID: <87fs6dzzzv.fsf@nosuchdomain.example.com>
References: <u79ug0$i1ks$1@dont-email.me> <Xm3mM.7635$3XE8.5950@fx42.iad>
<u7bee1$sht9$2@dont-email.me>
<871qhy1usn.fsf@nosuchdomain.example.com>
<u7buf9$ue5n$2@dont-email.me>
<87wmzqyro2.fsf@nosuchdomain.example.com>
<u7ctib$12pk1$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="a44f767d52f7a9230c899799d3560062";
logging-data="1145854"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/n1F4wN99E2hNAmzmVh0JZ"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:ww7wSsNCa85K/nCjCxeDcPsb6ow=
sha1:bBoraW4JZTwStMtb3+8rTmRs/UA=
 by: Keith Thompson - Mon, 26 Jun 2023 21:15 UTC

"R.Wieser" <address@is.invalid> writes:
> Keith,
>
>> Your newsreader should add attribution lines, like the
>> "R.Wieser" <address@is.invalid> writes:
>> line above. Please don't delete those lines. They're there
>> to show readers who wrote what.
>
> Thats why I have name the person I'm talking to at the top of my message -
> just like yours now.

Yes, I understand what you're doing and why you're doing it.

I'm asking you not to do that. I'm asking you to leave the generated
attribution lines in place, as everyone else here does. You're
expending extra effort and making your articles more difficult to read.

[...]

>> So if the user presses the up-arrow key, you see three bytes: Escape,
>> '[', and 'A', right? And you want to recognize that sequence as
>> "up-arrow"? I'm saying that readline does exactly that internally,
>> and examing the readline source code might be helpful.
>
> As mentioned in my initial post, I already wrote a parser. But I would like
> to replace it with something build-in, which is likely to support other
> $TERMs than just "linux". If a build-in method doesn't exist I will just
> continue using what I currently have.

If there is such an existing library, comp.lang.c++ is not the place to
ask about it. Nothing you've written here is specific to C++.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */

Re: Parsing multi-byte keystrokes

<87bkh1zz7t.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=523&group=comp.lang.c%2B%2B#523

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c++
Subject: Re: Parsing multi-byte keystrokes
Date: Mon, 26 Jun 2023 14:32:38 -0700
Organization: None to speak of
Lines: 68
Message-ID: <87bkh1zz7t.fsf@nosuchdomain.example.com>
References: <u79ug0$i1ks$1@dont-email.me> <lZ3mM.83590$8uge.57668@fx14.iad>
<87ilbb13tu.fsf@nosuchdomain.example.com>
<u7bee2$sht9$5@dont-email.me>
<877crq1va9.fsf@nosuchdomain.example.com>
<u7buf8$ue5n$1@dont-email.me>
<87o7l2yqvo.fsf@nosuchdomain.example.com>
<u7ctib$12pk1$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="a44f767d52f7a9230c899799d3560062";
logging-data="1152428"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ykUqulQH1yUP+4Wli+++Y"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:TtZH7dy+0YcZd0pY4vaQhlUfjQk=
sha1:3Hp6QWsyKxhk8BDqeotb0X6n0xs=
 by: Keith Thompson - Mon, 26 Jun 2023 21:32 UTC

"R.Wieser" <address@is.invalid> writes:
> Keith,
>
>>> As I said, the difference between them is /at best/ confusing. That you
>>> than introduce "system console" without offering any explanation to it
>>> does
>>> not help either. :-|
>>
>> Apparently it helped you to find more information.
>
> No, it didn't. I could not care less about what, on my machine, the
> difference is between a "system console" and a "console". But I *had* to
> search for it, because it *could* have been of importance in regard to the
> distinction between a "console" and a "terminal". It wasn't. IOW, I wasted
> my time.

I do not accept responsibility for that.

>> It's fairly common to use the word "console" (perhaps incorrectly)
>> to refer to terminals in general.
>
> Thats what I said. They are pretty-much used interchangably.

That's not what I said. The term "console", when used correctly for
Linux-based systems and probably some others, refers to the virtual
consoles typically accessed via Ctrl-Alt-FN or Alt-FN -- *not* to
terminal emulators like xterm. Some people are sloppy about the usage
(and it often doesn't matter, since they really are quite similar in
most ways.)

(There's also an "xconsole" command that runs under X11 and displays
messages sent to /dev/console. The fact that these things that were
once handled in hardware are now almost entirely handled in software
does create some confusion.)

> Currently I still do not know with what I should refer to the
> console/terminal/tty/whatever on which the boot-process outputs its progress
> and I than use to program in. Or with what I should refer to the ones under
> ALT F2...F6.

They're called virtual consoles.

>> Terminal emulators typically run as windows under X11 (or Wayland,
>> or whatever).
>
> Any reason for the "emulator" postfix ? Other than by habit I mean ? And
> yes, I recognise that a console in a window puts character based content in
> a pixel-based environment.

Yes. A literal *terminal* is a hardware device that includes a monitor,
a keyboard, and some kind of connector. The VT100 is an example. A
terminal emulator is a software program designed to emulate a terminal.
Terminal emulators are far more common these days than physical
terminals.

> To be honest, I took the "terminal emulator" as being a /program/ which runs
> on another computer, translating whatever it gets into screen output, and
> translates keyboard input to whatever the other side needs (VT100 codes or
> alike).

Right -- except that it doesn't have to run on another computer.

[...]

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */

Re: Parsing multi-byte keystrokes

<877crpzz39.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=524&group=comp.lang.c%2B%2B#524

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c++
Subject: Re: Parsing multi-byte keystrokes
Date: Mon, 26 Jun 2023 14:35:22 -0700
Organization: None to speak of
Lines: 21
Message-ID: <877crpzz39.fsf@nosuchdomain.example.com>
References: <u79ug0$i1ks$1@dont-email.me> <Xm3mM.7635$3XE8.5950@fx42.iad>
<87edlz5cax.fsf@bsb.me.uk> <u7bee2$sht9$4@dont-email.me>
<877crq4cbp.fsf@bsb.me.uk> <u7c3qt$v2jh$1@dont-email.me>
<u7csb8$12hso$1@dont-email.me> <u7ctic$12pk1$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="a44f767d52f7a9230c899799d3560062";
logging-data="1152428"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18yfB+mr95bHzxVM1AK1AF1"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:kA/S3XaU1gHrkBwVDy6b2nw58YM=
sha1:Ho8sXNZ8Too6GwsoFApl+zIKmAY=
 by: Keith Thompson - Mon, 26 Jun 2023 21:35 UTC

"R.Wieser" <address@is.invalid> writes:
> Christian,
>
>> As written above, you can use the termcap or terminfo library. It tells
>> you what keystrokes correspond to which keys.
>
> A quick search shows me that "termcap" is a textfile which as been marked
> obsolete and that both are used to translate keystrokes into escape
> sequences. There where no results shown in regard to translating escape
> sequences back to keystrokes though.
>
> IOW, do you have any link(s) that show how the latter is supposed to be done
> ?

termcap and terminfo are specific to Unix-like systems, not to C++.
I suggest asking elsewhere.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */

Re: Parsing multi-byte keystrokes

<u7d1ma$13bem$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=525&group=comp.lang.c%2B%2B#525

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: aurio...@gmx.de (Christian Gollwitzer)
Newsgroups: comp.lang.c++
Subject: Re: Parsing multi-byte keystrokes
Date: Mon, 26 Jun 2023 23:58:33 +0200
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <u7d1ma$13bem$1@dont-email.me>
References: <u79ug0$i1ks$1@dont-email.me> <Xm3mM.7635$3XE8.5950@fx42.iad>
<87edlz5cax.fsf@bsb.me.uk> <u7bee2$sht9$4@dont-email.me>
<877crq4cbp.fsf@bsb.me.uk> <u7c3qt$v2jh$1@dont-email.me>
<u7csb8$12hso$1@dont-email.me> <u7ctic$12pk1$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 26 Jun 2023 21:58:34 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="97c8d488b537bebb57da30d6a7f12760";
logging-data="1158614"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX191teTK/Q8PyCBHoU3NLhi9ZRj6sCOUQQc="
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.12.0
Cancel-Lock: sha1:ckfFMeOmU1cXBxAP9Qf4LA2BmME=
In-Reply-To: <u7ctic$12pk1$3@dont-email.me>
 by: Christian Gollwitzer - Mon, 26 Jun 2023 21:58 UTC

Am 26.06.23 um 22:48 schrieb R.Wieser:
> Christian,
>
>> As written above, you can use the termcap or terminfo library. It tells
>> you what keystrokes correspond to which keys.
>
> A quick search shows me that "termcap" is a textfile which as been marked
> obsolete and that both are used to translate keystrokes into escape
> sequences. There where no results shown in regard to translating escape
> sequences back to keystrokes though.
>
> IOW, do you have any link(s) that show how the latter is supposed to be done
> ?

The termcap library is only a way to do the forward translation, i.e.
you can ask it for a key and get back the string that is represented
like this:
https://stackoverflow.com/questions/55090078/termcap-tgetstr-getting-arrow-keys

However, I still believe you are much better off using the ncurses
library, which also does the backwards translation. Look, e.g. at this
example:

https://tldp.org/HOWTO/NCURSES-Programming-HOWTO/keys.html

As you can see here, the getch() function translates the special keys to
their symbolic code liek KEY_UP etc.

But cave: I gave up text mode programming a long time ago.

Christian

Re: Parsing multi-byte keystrokes

<gpomM.8406$JLp4.4652@fx46.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=526&group=comp.lang.c%2B%2B#526

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx46.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Parsing multi-byte keystrokes
Newsgroups: comp.lang.c++
References: <u79ug0$i1ks$1@dont-email.me> <87wmzqyro2.fsf@nosuchdomain.example.com> <u7ctib$12pk1$1@dont-email.me>
Lines: 23
Message-ID: <gpomM.8406$JLp4.4652@fx46.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Mon, 26 Jun 2023 22:35:56 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Mon, 26 Jun 2023 22:35:56 GMT
X-Received-Bytes: 1465
 by: Scott Lurndal - Mon, 26 Jun 2023 22:35 UTC

"R.Wieser" <address@is.invalid> writes:
>Keith,
>
>> Your newsreader should add attribution lines, like the
>> "R.Wieser" <address@is.invalid> writes:
>> line above. Please don't delete those lines. They're there
>> to show readers who wrote what.
>
>Thats why I have name the person I'm talking to at the top of my message -
>just like yours now.

No, you deleted the standard attribution lines. Which when properly
done, allow easy determination of who wrote what. That convention is
likely older than you are.

>
>Also, my newsreader is more than 20 years old, and even it has got a tree
>view with which I can easily go backwards to parent messages and forwards to
>replies to my posts. I seldom-if-ever use it though. I could imagine that
>yours has the same capability.

You would be wrong.

Re: Parsing multi-byte keystrokes

<FuomM.8435$JLp4.176@fx46.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=527&group=comp.lang.c%2B%2B#527

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx46.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Parsing multi-byte keystrokes
Newsgroups: comp.lang.c++
References: <u79ug0$i1ks$1@dont-email.me> <87o7l2yqvo.fsf@nosuchdomain.example.com> <u7ctib$12pk1$2@dont-email.me>
Lines: 37
Message-ID: <FuomM.8435$JLp4.176@fx46.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Mon, 26 Jun 2023 22:41:41 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Mon, 26 Jun 2023 22:41:41 GMT
X-Received-Bytes: 2174
 by: Scott Lurndal - Mon, 26 Jun 2023 22:41 UTC

"R.Wieser" <address@is.invalid> writes:
>Keith,
>
>>> As I said, the difference between them is /at best/ confusing. That you
>>> than introduce "system console" without offering any explanation to it
>>> does
>>> not help either. :-|
>>
>> Apparently it helped you to find more information.
>
>No, it didn't. I could not care less about what, on my machine, the
>difference is between a "system console" and a "console". But I *had* to
>search for it, because it *could* have been of importance in regard to the
>distinction between a "console" and a "terminal". It wasn't. IOW, I wasted
>my time.
>
>> It's fairly common to use the word "console" (perhaps incorrectly)
>> to refer to terminals in general.
>
>Thats what I said. They are pretty-much used interchangably.
>
>Currently I still do not know with what I should refer to the
>console/terminal/tty/whatever on which the boot-process outputs its progress
>and I than use to program in. Or with what I should refer to the ones under
>ALT F2...F6.

The unix 'tty' command will tell you the name of
the node in /dev that corresponds to your controlling
terminal. That name might be /dev/console for the
device that owns the host keyboard/mouse/graphic card;
normally known as the system console.

The name might instead be /dev/ttys0, or /dev/usbtty0, or
/dev/serial/0 for a serial attached device, or may be
/dev/pts/17 for a pseudo-terminal pair (e.g. used by
xterm, gnome terminal and other gui and non-gui
terminal emulators.

Re: Parsing multi-byte keystrokes

<87zg4lyfdd.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=528&group=comp.lang.c%2B%2B#528

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c++
Subject: Re: Parsing multi-byte keystrokes
Date: Mon, 26 Jun 2023 16:26:38 -0700
Organization: None to speak of
Lines: 43
Message-ID: <87zg4lyfdd.fsf@nosuchdomain.example.com>
References: <u79ug0$i1ks$1@dont-email.me> <Xm3mM.7635$3XE8.5950@fx42.iad>
<87edlz5cax.fsf@bsb.me.uk> <u7bee2$sht9$4@dont-email.me>
<877crq4cbp.fsf@bsb.me.uk> <u7c3qt$v2jh$1@dont-email.me>
<u7csb8$12hso$1@dont-email.me> <u7ctic$12pk1$3@dont-email.me>
<u7d1ma$13bem$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="a853ce57f0cc376f52e20a2b97585134";
logging-data="1183766"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18dZ98wCJAivE5eTogMr9jq"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:PV7ZtA9TpniqhHy+PfdVd0d/4o4=
sha1:hPTwv7QyExs8HtaMCll+C/FiEhk=
 by: Keith Thompson - Mon, 26 Jun 2023 23:26 UTC

Christian Gollwitzer <auriocus@gmx.de> writes:
> Am 26.06.23 um 22:48 schrieb R.Wieser:
>> Christian,
>>
>>> As written above, you can use the termcap or terminfo library. It tells
>>> you what keystrokes correspond to which keys.
>> A quick search shows me that "termcap" is a textfile which as been
>> marked
>> obsolete and that both are used to translate keystrokes into escape
>> sequences. There where no results shown in regard to translating escape
>> sequences back to keystrokes though.
>> IOW, do you have any link(s) that show how the latter is supposed to
>> be done
>> ?
>
> The termcap library is only a way to do the forward translation,
> i.e. you can ask it for a key and get back the string that is
> represented like this:
> https://stackoverflow.com/questions/55090078/termcap-tgetstr-getting-arrow-keys

No, terminfo is newer and is intended to replace termcap, and provides
the same information. If you're starting something new, ignore termcap
and use terminfo (unless you have some specific requirement to use
termcap).

> However, I still believe you are much better off using the ncurses
> library, which also does the backwards translation. Look, e.g. at this
> example:
>
> https://tldp.org/HOWTO/NCURSES-Programming-HOWTO/keys.html
>
> As you can see here, the getch() function translates the special keys
> to their symbolic code liek KEY_UP etc.

Yes, but it's not suitable for the OP's purposes. getch() implicitly
refers to the current ncurses screen (stdscr), and it can't be used
without first setting things up properly, which takes over the terminal
screen. (And comp.lang.c++ isn't the place to ask about it.)

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */

Re: Parsing multi-byte keystrokes

<1dd24214-49c8-4f61-a1b0-95331b82888dn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=529&group=comp.lang.c%2B%2B#529

  copy link   Newsgroups: comp.lang.c++
X-Received: by 2002:a05:6214:a82:b0:635:dddc:1779 with SMTP id ev2-20020a0562140a8200b00635dddc1779mr275774qvb.7.1687897962173;
Tue, 27 Jun 2023 13:32:42 -0700 (PDT)
X-Received: by 2002:a81:ad24:0:b0:576:f208:4d91 with SMTP id
l36-20020a81ad24000000b00576f2084d91mr1353420ywh.4.1687897961769; Tue, 27 Jun
2023 13:32:41 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c++
Date: Tue, 27 Jun 2023 13:32:41 -0700 (PDT)
In-Reply-To: <u7buf9$ue5n$3@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=124.218.76.41; posting-account=0Ek0TQoAAAAS0oceh95IuNV59QuIWNeN
NNTP-Posting-Host: 124.218.76.41
References: <u79ug0$i1ks$1@dont-email.me> <e992ebdc-2d53-4134-9cfd-fd9339c8ffe5n@googlegroups.com>
<u7buf9$ue5n$3@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1dd24214-49c8-4f61-a1b0-95331b82888dn@googlegroups.com>
Subject: Re: Parsing multi-byte keystrokes
From: wynii...@gmail.com (wij)
Injection-Date: Tue, 27 Jun 2023 20:32:42 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4253
 by: wij - Tue, 27 Jun 2023 20:32 UTC

On Monday, June 26, 2023 at 7:57:44 PM UTC+8, R.Wieser wrote:
> Wij,
>
> [snip code]
>
> Thank you. Looking at the code I'm going to assume that receiving CTRL, ALT
> and SHIFT modifier keys too is just a setting added to the "ntio.iflag"
> field. I'll just have to check/find out which one it is. :-)
>
> Regards,
> Rudy Wiesr

Class RawTerm was revised from the previous post, because I felt class RawTerm
could be quite reusable for terminals and keyboard input(set open flags to O_RDONLY).
So I revised RawTerm, added a member function kbhit().

------------------------
#include <Wy.stdio.h> // for cin,cout,cerr
#include <Wy.termios.h>
#include <Wy.unistd.h>
#include <Wy.select.h>

using namespace Wy;

// TTY i/o (raw mode terminal)
// RawTerm changes tty attributes so that we can read key stroke without press ENTER
//
// Warning: Many virtual members of ChrFile are not reimplemented for simplicity.
//
class RawTerm : public ChrFile {
Termios m_ptio; // Previous(original) termios setting
public:
WY_DECL_REPLY;
RawTerm() {};
RawTerm(const char*, int);
~RawTerm();
Errno getch(char&);
Errno kbhit();
};
RawTerm::RawTerm(const char* pathname, int flag)
try : ChrFile(pathname,flag)
{ Errno r=tcflush(*this,TCIFLUSH);
if(r!=Ok) {
WY_THROW(r);
}
if((r=tcgetattr(*this,m_ptio))!=Ok) {
WY_THROW(r);
}

// Set the terminal mode
//
Termios ntio(m_ptio);
ntio.iflag_and(~(BRKINT| ICRNL| IXON| INPCK | ISTRIP));
ntio.lflag_and(~(ICANON| ECHO| ISIG| TOSTOP| IEXTEN));
ntio.oflag_and( ~(OPOST) );
ntio.cflag_or( CS8 );
ntio.cc_VMIN(1);
ntio.cc_VTIME(0);
if((r=tcsetattr(*this,TCSANOW,ntio))!=Ok) {
WY_THROW(r);
}

// Read back check
Termios tmptio;
if((r=tcgetattr(*this,tmptio))!=Ok) {
WY_THROW(r);
}

// Omitted: Check termios setting accepted or not
} catch(const Errno& e) {
throw Reply(e);
};

RawTerm::~RawTerm()
{ // If *this is default, these functions just fail (no effect for any device)
Errno r;
r=tcflush(*this,TCIFLUSH);
r=tcsetattr(*this,TCSANOW,m_ptio);
};

// Get one char from terminal
//
Errno RawTerm::getch(char& ch)
{ Errno r;
size_t n;
if((r=ChrFile::read(&ch,sizeof(ch),n))!=Ok) {
WY_RETURN(r);
}
if(n!=sizeof(ch)) {
WY_RETURN(EIO);
}
return r;
};

Errno RawTerm::kbhit()
{ FdSet fds;
fds.set(*this);
return pselect(&fds,NULL,NULL,NULL,NULL);
};

int main(int, char* [])
try {
RawTerm mtty("/dev/tty",O_RDWR);
Errno r;

mtty << "Press any key. 'q' to quit:";
for(;;) {
char ch;
if((r=mtty.getch(ch))!=Ok) {
WY_THROW(r);
}
if((ch=='q')||(ch=='Q')) {
break;
}
mtty << (unsigned char)ch << " ";
}

// cin.reset(mtty); // dup2 cin to use mtty
return 0;
} catch(const Errno& e) {
cerr << wrd(e) << WY_ENDL;
return e.c_errno();
} catch(...) {
cerr << "main caught(...)" WY_ENDL;
throw;
};

Re: Parsing multi-byte keystrokes

<u7g584$1hv3t$1@news.xmission.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=530&group=comp.lang.c%2B%2B#530

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.lang.c++
Subject: Re: Parsing multi-byte keystrokes
Date: Wed, 28 Jun 2023 02:17:40 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <u7g584$1hv3t$1@news.xmission.com>
References: <u79ug0$i1ks$1@dont-email.me> <e992ebdc-2d53-4134-9cfd-fd9339c8ffe5n@googlegroups.com> <u7buf9$ue5n$3@dont-email.me> <1dd24214-49c8-4f61-a1b0-95331b82888dn@googlegroups.com>
Injection-Date: Wed, 28 Jun 2023 02:17:40 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="1637501"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Wed, 28 Jun 2023 02:17 UTC

In article <1dd24214-49c8-4f61-a1b0-95331b82888dn@googlegroups.com>,
wij <wyniijj5@gmail.com> wrote:
....
>Class RawTerm was revised from the previous post, because I felt class
>RawTerm could be quite reusable for terminals and keyboard input(set open
>flags to O_RDONLY). So I revised RawTerm, added a member function kbhit().

This is actually an interesting post, in terms of newsgroup politics.

This post is actually on-topic for the newsgroup, since it contains actual,
real, live C++ code, but entirely off-topic for the thread, since it has
nothing to do with OP's problem (which, in fact, has nothing to do with C++).

Interesting, that.

--
Modern Christian: Someone who can take time out from using Leviticus
to defend homophobia and Exodus to plaster the Ten Commandments on
every school and courthouse to claim that the Old Testament is merely
"ancient laws" that "only applies to Jews".

Re: Parsing multi-byte keystrokes

<e9fea6d9-9dc0-4e30-b47e-e2d4442d555fn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=531&group=comp.lang.c%2B%2B#531

  copy link   Newsgroups: comp.lang.c++
X-Received: by 2002:ad4:4b2c:0:b0:635:da85:d29e with SMTP id s12-20020ad44b2c000000b00635da85d29emr297838qvw.5.1687922818061;
Tue, 27 Jun 2023 20:26:58 -0700 (PDT)
X-Received: by 2002:a05:6808:2027:b0:3a2:6d07:ad48 with SMTP id
q39-20020a056808202700b003a26d07ad48mr239800oiw.4.1687922817648; Tue, 27 Jun
2023 20:26:57 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c++
Date: Tue, 27 Jun 2023 20:26:57 -0700 (PDT)
In-Reply-To: <u7g584$1hv3t$1@news.xmission.com>
Injection-Info: google-groups.googlegroups.com; posting-host=124.218.76.41; posting-account=0Ek0TQoAAAAS0oceh95IuNV59QuIWNeN
NNTP-Posting-Host: 124.218.76.41
References: <u79ug0$i1ks$1@dont-email.me> <e992ebdc-2d53-4134-9cfd-fd9339c8ffe5n@googlegroups.com>
<u7buf9$ue5n$3@dont-email.me> <1dd24214-49c8-4f61-a1b0-95331b82888dn@googlegroups.com>
<u7g584$1hv3t$1@news.xmission.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e9fea6d9-9dc0-4e30-b47e-e2d4442d555fn@googlegroups.com>
Subject: Re: Parsing multi-byte keystrokes
From: wynii...@gmail.com (wij)
Injection-Date: Wed, 28 Jun 2023 03:26:58 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3071
 by: wij - Wed, 28 Jun 2023 03:26 UTC

On Wednesday, June 28, 2023 at 10:17:57 AM UTC+8, Kenny McCormack wrote:
> In article <1dd24214-49c8-4f61...@googlegroups.com>,
> wij <wyni...@gmail.com> wrote:
> ...
> >Class RawTerm was revised from the previous post, because I felt class
> >RawTerm could be quite reusable for terminals and keyboard input(set open
> >flags to O_RDONLY). So I revised RawTerm, added a member function kbhit().
> This is actually an interesting post, in terms of newsgroup politics.
>
> This post is actually on-topic for the newsgroup, since it contains actual,
> real, live C++ code, but entirely off-topic for the thread, since it has
> nothing to do with OP's problem (which, in fact, has nothing to do with C++).
>
> Interesting, that.
>
> --
> Modern Christian: Someone who can take time out from using Leviticus
> to defend homophobia and Exodus to plaster the Ten Commandments on
> every school and courthouse to claim that the Old Testament is merely
> "ancient laws" that "only applies to Jews".

It is pretty much on topic in various ways, esp. in the early days.
C++ language is (should?) not confined to the words of 'the standard' book
(E.g. previously, there were c++.moderated, c++.standard. They are gone now).
Without the real usage, the language is purely manipulation of words as many
people are fond of.

I admit my reply might not be what the OP want, but who knows what the OP need?
I was suggesting, many 'keyboard' problems could be solved by using RawTerm like
class. The capability including serial line communication,..., 'remote debug'..etc.
One point here reminded is: many C++ programmer have no idea of OOD, lost in
the language syntax.

Re: Parsing multi-byte keystrokes

<u7i92g$1scnm$1@redfloyd.dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=533&group=comp.lang.c%2B%2B#533

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!redfloyd.dont-email.me!.POSTED!not-for-mail
From: no.spam....@its.invalid (red floyd)
Newsgroups: comp.lang.c++
Subject: Re: Parsing multi-byte keystrokes
Date: Wed, 28 Jun 2023 14:35:11 -0700
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <u7i92g$1scnm$1@redfloyd.dont-email.me>
References: <u79ug0$i1ks$1@dont-email.me> <Xm3mM.7635$3XE8.5950@fx42.iad>
<u7bee1$sht9$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 28 Jun 2023 21:35:12 -0000 (UTC)
Injection-Info: redfloyd.dont-email.me; posting-host="7a4f747a934a1c3b32755a547b5ae1ed";
logging-data="1979126"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/4huVduxaTPOfom8BjU8UfEoXrx2GG6wo="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.12.0
Cancel-Lock: sha1:DA+meleDYjkk+XnEfhk0JlgAjGQ=
In-Reply-To: <u7bee1$sht9$2@dont-email.me>
Content-Language: en-US
 by: red floyd - Wed, 28 Jun 2023 21:35 UTC

On 6/25/2023 11:50 PM, R.Wieser wrote:

> The problem with that is that I need the keys at the moment they are pressed
> (and released ?), not only after "enter" is pressed.

Then you need to put the terminal into non-canonical mode (~ICANON).

See "man tcsetattr"

Re: Parsing multi-byte keystrokes

<u7iiiq$1j6d8$1@news.xmission.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=534&group=comp.lang.c%2B%2B#534

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!tncsrv06.tnetconsulting.net!csiph.com!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.lang.c++
Subject: Re: Parsing multi-byte keystrokes
Date: Thu, 29 Jun 2023 00:17:30 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <u7iiiq$1j6d8$1@news.xmission.com>
References: <u79ug0$i1ks$1@dont-email.me> <Xm3mM.7635$3XE8.5950@fx42.iad> <u7bee1$sht9$2@dont-email.me> <u7i92g$1scnm$1@redfloyd.dont-email.me>
Injection-Date: Thu, 29 Jun 2023 00:17:30 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="1677736"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Thu, 29 Jun 2023 00:17 UTC

In article <u7i92g$1scnm$1@redfloyd.dont-email.me>,
red floyd <no.spam.here@its.invalid> wrote:
>On 6/25/2023 11:50 PM, R.Wieser wrote:
>
>
>> The problem with that is that I need the keys at the moment they are pressed
>> (and released ?), not only after "enter" is pressed.
>
>
>Then you need to put the terminal into non-canonical mode (~ICANON).
>
>See "man tcsetattr"
>
>
>

Totally missing the point.

OP certainly knows all about setting the terminal modes (to RAW and/or ~ICANON).

The comment quoted above was in the context of the OP responding to a
suggestion by another user. Other user had suggested using the GNU
"readline" library as a way of getting keystrokes. OP noted that readline,
as its name implies, only returns when it has a full line - i.e., when the
user has pressed the "enter" key to send the line.

Hope that clears things up for you.

--
12% of Americans think that Joan of Arc was Noah's wife.

Re: Parsing multi-byte keystrokes

<1t4nM.1647$fNr5.933@fx16.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=535&group=comp.lang.c%2B%2B#535

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx16.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Parsing multi-byte keystrokes
Newsgroups: comp.lang.c++
References: <u79ug0$i1ks$1@dont-email.me> <Xm3mM.7635$3XE8.5950@fx42.iad> <u7bee1$sht9$2@dont-email.me> <u7i92g$1scnm$1@redfloyd.dont-email.me> <u7iiiq$1j6d8$1@news.xmission.com>
Lines: 31
Message-ID: <1t4nM.1647$fNr5.933@fx16.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Thu, 29 Jun 2023 00:43:41 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Thu, 29 Jun 2023 00:43:41 GMT
X-Received-Bytes: 1859
 by: Scott Lurndal - Thu, 29 Jun 2023 00:43 UTC

gazelle@shell.xmission.com (Kenny McCormack) writes:
>In article <u7i92g$1scnm$1@redfloyd.dont-email.me>,
>red floyd <no.spam.here@its.invalid> wrote:
>>On 6/25/2023 11:50 PM, R.Wieser wrote:
>>
>>
>>> The problem with that is that I need the keys at the moment they are pressed
>>> (and released ?), not only after "enter" is pressed.
>>
>>
>>Then you need to put the terminal into non-canonical mode (~ICANON).
>>
>>See "man tcsetattr"
>>
>>
>>
>
>Totally missing the point.
>
>OP certainly knows all about setting the terminal modes (to RAW and/or ~ICANON).
>
>The comment quoted above was in the context of the OP responding to a
>suggestion by another user. Other user had suggested using the GNU
>"readline" library as a way of getting keystrokes. OP noted that readline,
>as its name implies, only returns when it has a full line - i.e., when the
>user has pressed the "enter" key to send the line.

However, readline and libedit internally handle vim and emacs line editing, for
which they must set the terminal to RAW mode, so the library sources
would be a useful resource for someone who wishes similar functionality.

Re: Parsing multi-byte keystrokes

<u7js2f$25ate$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=536&group=comp.lang.c%2B%2B#536

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: addr...@is.invalid (R.Wieser)
Newsgroups: comp.lang.c++
Subject: Re: Parsing multi-byte keystrokes
Date: Thu, 29 Jun 2023 13:15:59 +0200
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <u7js2f$25ate$1@dont-email.me>
References: <u79ug0$i1ks$1@dont-email.me> <87wmzqyro2.fsf@nosuchdomain.example.com> <u7ctib$12pk1$1@dont-email.me> <gpomM.8406$JLp4.4652@fx46.iad>
Injection-Date: Thu, 29 Jun 2023 12:05:35 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4939a30e3019636f9505df1fa9692ee0";
logging-data="2272174"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18f4rlu7IgPaH2Q3hSnNooxF4vnvABi4VhNXvqOgdhdiw=="
Cancel-Lock: sha1:pKDK+jIVyEbUi3i21s0vjQkfHGI=
X-MSMail-Priority: Normal
X-RFC2646: Format=Flowed; Original
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
 by: R.Wieser - Thu, 29 Jun 2023 11:15 UTC

Scott,

>> Also, my newsreader is more than 20 years old, and even it has got a
>> tree view with which I can easily go backwards to parent messages
>> and forwards to replies to my posts. I seldom-if-ever use it
>> though. I could imagine that yours has the same capability.
>
> You would be wrong.

No, I don't think so. It could really easily imagine that.

/s

Regards,
Rudy Wieser

Re: Parsing multi-byte keystrokes

<u7js2f$25ate$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=537&group=comp.lang.c%2B%2B#537

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: addr...@is.invalid (R.Wieser)
Newsgroups: comp.lang.c++
Subject: Re: Parsing multi-byte keystrokes
Date: Thu, 29 Jun 2023 13:58:27 +0200
Organization: A noiseless patient Spider
Lines: 49
Message-ID: <u7js2f$25ate$2@dont-email.me>
References: <u79ug0$i1ks$1@dont-email.me> <87o7l2yqvo.fsf@nosuchdomain.example.com> <u7ctib$12pk1$2@dont-email.me> <FuomM.8435$JLp4.176@fx46.iad>
Injection-Date: Thu, 29 Jun 2023 12:05:35 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4939a30e3019636f9505df1fa9692ee0";
logging-data="2272174"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18eA/BFm+8kgwPEbLmmwdxcYsHjXjhaJLCYPFUZw7KZTw=="
Cancel-Lock: sha1:HPKrN6KTDnvyGGEty69nUAozyu4=
X-RFC2646: Format=Flowed; Original
X-Priority: 3
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-MSMail-Priority: Normal
 by: R.Wieser - Thu, 29 Jun 2023 11:58 UTC

Scott,

>>Currently I still do not know with what I should refer to the
>>console/terminal/tty/whatever on which the boot-process outputs its
>>progress
>>and I than use to program in. Or with what I should refer to the ones
>>under
>>ALT F2...F6.
>
> The unix 'tty' command will tell [snip]

Alas, I thought that my above question (in the above quote) was clear
enough. But no.

I'll try again, but now dotting some "i"s.

1) The screen the boot process is outputting its progress into is called :

a) a console
b) a system console
c) a terminal
d) a virtual terminal
e) a tty
f) something else altogether.

Explain why.

2)The screen that becomes visible when the ALT F2...F6 keys is pressed is
called :

a) a console
b) a system console
c) a terminal
d) a virtual terminal
e) a tty
f) something else altogether.

Explain why.

Bonus question :

For any of the choices in the above that have not already been used explain
when those are used and why.

Regards,
Rudy Wieser

Re: Parsing multi-byte keystrokes

<u7js2g$25ate$3@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=538&group=comp.lang.c%2B%2B#538

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: addr...@is.invalid (R.Wieser)
Newsgroups: comp.lang.c++
Subject: Re: Parsing multi-byte keystrokes
Date: Thu, 29 Jun 2023 14:04:13 +0200
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <u7js2g$25ate$3@dont-email.me>
References: <u79ug0$i1ks$1@dont-email.me> <Xm3mM.7635$3XE8.5950@fx42.iad> <u7bee1$sht9$2@dont-email.me> <u7i92g$1scnm$1@redfloyd.dont-email.me> <u7iiiq$1j6d8$1@news.xmission.com> <1t4nM.1647$fNr5.933@fx16.iad>
Injection-Date: Thu, 29 Jun 2023 12:05:36 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4939a30e3019636f9505df1fa9692ee0";
logging-data="2272174"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/FSz8fCL2/lKZPbAWXOSZDpHE2sTOsRLZGBJ5fbUjWwg=="
Cancel-Lock: sha1:R3n2yDOF6HCSvPMgQM+vkidUnS8=
X-MSMail-Priority: Normal
X-RFC2646: Format=Flowed; Original
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-Priority: 3
 by: R.Wieser - Thu, 29 Jun 2023 12:04 UTC

Scott,

> However, readline and libedit internally handle vim and emacs line
> editing, for which they must set the terminal to RAW mode, so the
> library sources would be a useful resource for someone who wishes
> similar functionality.

But of little, if any, use to someone who started his initial post with
"I've set the console input to raw so I can see keys coming in when they are
pressed."

Indicating both already having done that /and/ getting a result he can work
with.

Regards,
Rudy Wieser

Re: Parsing multi-byte keystrokes

<u7k8sc$1k9jg$1@news.xmission.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=541&group=comp.lang.c%2B%2B#541

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.lang.c++
Subject: Re: Parsing multi-byte keystrokes
Date: Thu, 29 Jun 2023 15:44:12 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <u7k8sc$1k9jg$1@news.xmission.com>
References: <u79ug0$i1ks$1@dont-email.me> <u7iiiq$1j6d8$1@news.xmission.com> <1t4nM.1647$fNr5.933@fx16.iad> <u7js2g$25ate$3@dont-email.me>
Injection-Date: Thu, 29 Jun 2023 15:44:12 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="1713776"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Thu, 29 Jun 2023 15:44 UTC

In article <u7js2g$25ate$3@dont-email.me>, R.Wieser <address@is.invalid> wrote:
>Scott,
>
>> However, readline and libedit internally handle vim and emacs line
>> editing, for which they must set the terminal to RAW mode, so the
>> library sources would be a useful resource for someone who wishes
>> similar functionality.
>
>But of little, if any, use to someone who started his initial post with
>"I've set the console input to raw so I can see keys coming in when they are
>pressed."
>
>Indicating both already having done that /and/ getting a result he can work
>with.

Indeed. Well put. There have been several responses on this thread that
have "totally missed the point" - assuming that your issue was "How do I
set the terminal to raw mode?" - when, obviously, you'd already done that.

Maybe a language barrier problem. English not being their first language.

Aside: Some have suggested, as above, that you read/study the readline
source code for inspiration. I doubt that will help, as that code is
pretty opaque.

What this all boils down to is that there really should be an off-the-shelf
solution to this all-too-common problem. There apparently isn't. It should
be possible for someone to rip that functionality out of (n)curses, so that
you could use it, without the full-on commitment to (n)curses.

--
No puppet.
No puppet.
You're a puppet.

Re: Parsing multi-byte keystrokes

<u7kc0s$26v5q$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=543&group=comp.lang.c%2B%2B#543

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: addr...@is.invalid (R.Wieser)
Newsgroups: comp.lang.c++
Subject: Re: Parsing multi-byte keystrokes
Date: Thu, 29 Jun 2023 18:37:28 +0200
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <u7kc0s$26v5q$1@dont-email.me>
References: <u79ug0$i1ks$1@dont-email.me> <u7iiiq$1j6d8$1@news.xmission.com> <1t4nM.1647$fNr5.933@fx16.iad> <u7js2g$25ate$3@dont-email.me> <u7k8sc$1k9jg$1@news.xmission.com>
Injection-Date: Thu, 29 Jun 2023 16:37:48 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4939a30e3019636f9505df1fa9692ee0";
logging-data="2325690"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19RuPeEhIcCQPRsp5BHk5xzesp69f4QCu674K3x1m91SQ=="
Cancel-Lock: sha1:tvTeh72Ljjj1KbSw+unrUX5121c=
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-Priority: 3
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MSMail-Priority: Normal
 by: R.Wieser - Thu, 29 Jun 2023 16:37 UTC

Kenny,

> Maybe a language barrier problem. English not being their first
> language.

There is also a good possibility that, as you mentioned yourself, the
responder just read a single post and took their (absense of a) clue from
there. Not bothering to even check out the threads starting post.

> What this all boils down to is that there really should be an off-
> the-shelf solution to this all-too-common problem.

:-) and that was/is pretty-much exactly what I was thinking, and tried to
find out, thru this newsgroup, if it exists.

Color me surprised that I now have to conclude a programmer has to write,
for *every program* which does not use a line-based input method, such a
parser himself.

> It should be possible for someone to rip that functionality out of
> (n)curses, so that you could use it, without the full-on commitment
> to (n)curses.

Depends on how it needs to be used. Currently I've got some code which
times out if nothing comes in or something incomplete has been parsed (it
doesn't block).

And by the way: I have quite a problem with the ^Z (26) being send as the
start of a command sequence as well on its own when the ESC key is pressed
(IOW, no escaping of the ESC key). I do not see any way to, in a stream,
detect if its one or the other. Its just asking for trouble. :-(

Regards,
Rudy Wieser

Re: Parsing multi-byte keystrokes

<87bkgyrnmz.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=544&group=comp.lang.c%2B%2B#544

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c++
Subject: Re: Parsing multi-byte keystrokes
Date: Thu, 29 Jun 2023 13:59:00 -0700
Organization: None to speak of
Lines: 65
Message-ID: <87bkgyrnmz.fsf@nosuchdomain.example.com>
References: <u79ug0$i1ks$1@dont-email.me>
<87o7l2yqvo.fsf@nosuchdomain.example.com>
<u7ctib$12pk1$2@dont-email.me> <FuomM.8435$JLp4.176@fx46.iad>
<u7js2f$25ate$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="17b163af35672b5a9d241ecc92170355";
logging-data="2382676"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/T/IzrnbuSQkpDKP0HTX7f"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:0itWmvV4sEYOlQydf1HdCa951xs=
sha1:g9Y7AIAS38MFnD+vxj/Ddd+gK/Y=
 by: Keith Thompson - Thu, 29 Jun 2023 20:59 UTC

"R.Wieser" <address@is.invalid> writes:
> Scott,
>>>Currently I still do not know with what I should refer to the
>>>console/terminal/tty/whatever on which the boot-process outputs its
>>>progress
>>>and I than use to program in. Or with what I should refer to the ones
>>>under
>>>ALT F2...F6.
>>
>> The unix 'tty' command will tell [snip]
>
> Alas, I thought that my above question (in the above quote) was clear
> enough. But no.
>
> I'll try again, but now dotting some "i"s.
>
>
> 1) The screen the boot process is outputting its progress into is called :
>
> a) a console
> b) a system console
> c) a terminal
> d) a virtual terminal
> e) a tty
> f) something else altogether.
>
> Explain why.
>
> 2)The screen that becomes visible when the ALT F2...F6 keys is pressed is
> called :
>
> a) a console
> b) a system console
> c) a terminal
> d) a virtual terminal
> e) a tty
> f) something else altogether.
>
> Explain why.
>
> Bonus question :
>
> For any of the choices in the above that have not already been used explain
> when those are used and why.

None of these questions are about C++.

I can understand that you might think attribution lines are
unnecessary, but you refuse to leave them in place after being asked
to do so. It's *easier* to leave them alone than to delete them,
and for many of us it makes it easier to follow the discussion.
You even delete attribution lines from quoted text; there's no
indication who wrote the text above starting with "Currently I
still do not know".

You continue to post here in comp.lang.c++ when it's clear that
another forum such as comp.unix.programmer would be more appropriate
and more likely to get you the information you're looking for.

You want answers? Learn where and how to ask.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */

Re: Parsing multi-byte keystrokes

<x%qnM.8072$W7d4.5898@fx18.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=545&group=comp.lang.c%2B%2B#545

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!news.neodome.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer02.ams4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx18.iad.POSTED!not-for-mail
Subject: Re: Parsing multi-byte keystrokes
Newsgroups: comp.lang.c++
References: <u79ug0$i1ks$1@dont-email.me> <Xm3mM.7635$3XE8.5950@fx42.iad>
<u7bee1$sht9$2@dont-email.me>
From: pauldont...@removeyourself.dontspam.yahoo (Pavel)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.16
MIME-Version: 1.0
In-Reply-To: <u7bee1$sht9$2@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 49
Message-ID: <x%qnM.8072$W7d4.5898@fx18.iad>
X-Complaints-To: https://www.astraweb.com/aup
NNTP-Posting-Date: Fri, 30 Jun 2023 02:22:21 UTC
Date: Thu, 29 Jun 2023 22:21:57 -0400
X-Received-Bytes: 1765
 by: Pavel - Fri, 30 Jun 2023 02:21 UTC

R.Wieser wrote:
> Pavel,
>
>> On Linux (strictly speaking, on a GNU system) specifically, try readline
>> function.
>
> The problem with that is that I need the keys at the moment they are pressed
> (and released ?), not only after "enter" is pressed.
I got it from your first post :-).

With readline, you *don't have to wait till <enter> is pressed* to get
the key.

I have posted this example in my response to Keith Thompson on 6/25/23
10:18 pm, it might just work for your purpose.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <readline/readline.h>

int
up_callback(int count, int key) {
printf ("the user just pressed up-arrow\n");
return 0;
}

int
main(int argc, char *argv[])
{ rl_bind_keyseq ("\\e[A", up_callback);
free(readline("press a button > "));

printf("\n");

return 0;
}

>
> Regards,
> Rudy Wieser
>
>

HTH
-Pavel

Re: Parsing multi-byte keystrokes

<8735293xdb.fsf@bsb.me.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=548&group=comp.lang.c%2B%2B#548

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c++
Subject: Re: Parsing multi-byte keystrokes
Date: Fri, 30 Jun 2023 14:14:55 +0100
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <8735293xdb.fsf@bsb.me.uk>
References: <u79ug0$i1ks$1@dont-email.me> <u7iiiq$1j6d8$1@news.xmission.com>
<1t4nM.1647$fNr5.933@fx16.iad> <u7js2g$25ate$3@dont-email.me>
<u7k8sc$1k9jg$1@news.xmission.com> <u7kc0s$26v5q$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="a4b05ae8aedf0607a60b70f6ae5acfc5";
logging-data="2687567"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+AjJLxXXNdxchiHLrqfJtkyDDaGb9/f9Y="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:qdmfZt86UUL/lUmM0PDdDD+J4LQ=
sha1:F8WAn4pvE63/C1j/ckU/tx/peA8=
X-BSB-Auth: 1.ae9f5943b12897cf64e2.20230630141456BST.8735293xdb.fsf@bsb.me.uk
 by: Ben Bacarisse - Fri, 30 Jun 2023 13:14 UTC

"R.Wieser" <address@is.invalid> writes:

>> What this all boils down to is that there really should be an off-
>> the-shelf solution to this all-too-common problem.
>
> :-) and that was/is pretty-much exactly what I was thinking, and tried to
> find out, thru this newsgroup, if it exists.

As far as I can tell there /is/ a solution, but this, being a C++ group,
is not the best one for the question so maybe no one has given the
details.

> Color me surprised that I now have to conclude a programmer has to write,
> for *every program* which does not use a line-based input method, such a
> parser himself.
>
>> It should be possible for someone to rip that functionality out of
>> (n)curses, so that you could use it, without the full-on commitment
>> to (n)curses.

I think the solution is right there in ncurses.

> Depends on how it needs to be used. Currently I've got some code which
> times out if nothing comes in or something incomplete has been parsed (it
> doesn't block).

ncurses provides a function to do this parsing with and without a
timeout. If that is not, in fact, what you want then you should explain
why ncurses's "keypad" setting does not do what you want.

--
Ben.

Re: Parsing multi-byte keystrokes

<u7muuc$2j6av$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=550&group=comp.lang.c%2B%2B#550

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: addr...@is.invalid (R.Wieser)
Newsgroups: comp.lang.c++
Subject: Re: Parsing multi-byte keystrokes
Date: Fri, 30 Jun 2023 17:50:34 +0200
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <u7muuc$2j6av$1@dont-email.me>
References: <u79ug0$i1ks$1@dont-email.me> <Xm3mM.7635$3XE8.5950@fx42.iad> <u7bee1$sht9$2@dont-email.me> <x%qnM.8072$W7d4.5898@fx18.iad>
Injection-Date: Fri, 30 Jun 2023 16:13:00 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="999079f0f9c12e6b591b4c71d27be2f9";
logging-data="2726239"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19cOVQWoqQwfd1jXbI7TWyr9DsL7jInvm1izkHngcLwmg=="
Cancel-Lock: sha1:8lIEJXXgqs/b7RK5aMRi0MIxeW4=
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MSMail-Priority: Normal
X-Priority: 3
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
 by: R.Wieser - Fri, 30 Jun 2023 15:50 UTC

Pavel,

> With readline, you *don't have to wait till <enter> is pressed* to get the
> key.

[snip code]

Thank you very much. I'm certainly going to check that out. If that works
the way it looks it saves me a /lot/ of work.

.... though to be honest, I feel like I'm back in dos batch, abusing stuff
left and right to get things done. :-| :-)

Regards,
Rudy Wieser

Re: Parsing multi-byte keystrokes

<u7muuc$2j6av$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=551&group=comp.lang.c%2B%2B#551

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: addr...@is.invalid (R.Wieser)
Newsgroups: comp.lang.c++
Subject: Re: Parsing multi-byte keystrokes
Date: Fri, 30 Jun 2023 18:12:34 +0200
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <u7muuc$2j6av$2@dont-email.me>
References: <u79ug0$i1ks$1@dont-email.me> <u7iiiq$1j6d8$1@news.xmission.com><1t4nM.1647$fNr5.933@fx16.iad> <u7js2g$25ate$3@dont-email.me><u7k8sc$1k9jg$1@news.xmission.com> <u7kc0s$26v5q$1@dont-email.me> <8735293xdb.fsf@bsb.me.uk>
Injection-Date: Fri, 30 Jun 2023 16:13:00 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="999079f0f9c12e6b591b4c71d27be2f9";
logging-data="2726239"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+vT3WilBoF2RmIhfvAmFnpHMLWHCsIVhEc4wFp0aVz/Q=="
Cancel-Lock: sha1:zB3lDvFu6odCjESGvS7Zt2CT5VM=
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
 by: R.Wieser - Fri, 30 Jun 2023 16:12 UTC

Ben,

> As far as I can tell there /is/ a solution, but this, being a C++
> group, is not the best one for the question so maybe no one has
> given the details.

I assumed that a good percentage of users here would be using Linux, and the
question would make sense to them. I must have assumed wrong.

> ncurses provides a function to do this parsing with and without
> a timeout. If that is not, in fact, what you want then you should
> explain why ncurses's "keypad" setting does not do what you want.

I would need to install it (its not part of the OS installation) and I've
heard that its a bit "demanding" :

[quote=Alf P. Steinbach, Sun, 25 Jun 2023 15:06:29 -0700]
curses takes over the entire (text / terminal) screen, keeping track of what
character is shown at each location and using minimal output to update it as
needed.
[/quote]

Which is /absolutily not/ what I'm currently looking for. Thats like using
a cannon to kill a mosquito.

Regards,
Rudy Wieser

Re: Parsing multi-byte keystrokes

<3FDnM.3755$edN3.1654@fx14.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=552&group=comp.lang.c%2B%2B#552

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx14.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Parsing multi-byte keystrokes
Newsgroups: comp.lang.c++
References: <u79ug0$i1ks$1@dont-email.me> <u7kc0s$26v5q$1@dont-email.me> <8735293xdb.fsf@bsb.me.uk> <u7muuc$2j6av$2@dont-email.me>
Lines: 687
Message-ID: <3FDnM.3755$edN3.1654@fx14.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Fri, 30 Jun 2023 16:45:51 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Fri, 30 Jun 2023 16:45:51 GMT
X-Received-Bytes: 45244
 by: Scott Lurndal - Fri, 30 Jun 2023 16:45 UTC

"R.Wieser" <address@is.invalid> writes:
>Ben,
>
>> As far as I can tell there /is/ a solution, but this, being a C++
>> group, is not the best one for the question so maybe no one has
>> given the details.
>
>I assumed that a good percentage of users here would be using Linux, and the
>question would make sense to them. I must have assumed wrong.
>
>> ncurses provides a function to do this parsing with and without
>> a timeout. If that is not, in fact, what you want then you should
>> explain why ncurses's "keypad" setting does not do what you want.
>
>I would need to install it (its not part of the OS installation) and I've
>heard that its a bit "demanding" :
>
>[quote=Alf P. Steinbach, Sun, 25 Jun 2023 15:06:29 -0700]
>curses takes over the entire (text / terminal) screen, keeping track of what
>character is shown at each location and using minimal output to update it as
>needed.
>[/quote]

Not everything you "hear" is accurate. Nor is this group a bastion
of linux expertise, most posters are windows users near as I can tell.

curses/ncurses is library with a wide range of functionality,
the manual pages can be informative.

$ man -k curses
BC (3x) - direct curses interface to the terminfo capability database
COLORS (3x) - curses global variables
_nc_free_and_exit (3x) - curses memory-leak checking
_nc_freeall (3x) - curses memory-leak checking
_nc_tracebits (3x) - curses debugging routines
_traceattr (3x) - curses debugging routines
_traceattr2 (3x) - curses debugging routines
_tracecchar_t (3x) - curses debugging routines
_tracecchar_t2 (3x) - curses debugging routines
_tracechar (3x) - curses debugging routines
_tracechtype (3x) - curses debugging routines
_tracechtype2 (3x) - curses debugging routines
_tracedump (3x) - curses debugging routines
_tracef (3x) - curses debugging routines
_tracemouse (3x) - curses debugging routines
acs_map (3x) - curses terminfo global variables
add_wch (3x) - add a complex character and rendition to a curses window, then advance the cursor
add_wchnstr (3x) - add an array of complex characters (and attributes) to a curses window
add_wchstr (3x) - add an array of complex characters (and attributes) to a curses window
addch (3x) - add a character (with attributes) to a curses window, then advance the cursor
addchnstr (3x) - add a string of characters (and attributes) to a curses window
addchstr (3x) - add a string of characters (and attributes) to a curses window
addnstr (3x) - add a string of characters to a curses window and advance cursor
addnwstr (3x) - add a string of wide characters to a curses window and advance cursor
addstr (3x) - add a string of characters to a curses window and advance cursor
addwstr (3x) - add a string of wide characters to a curses window and advance cursor
alsamixer (1) - soundcard mixer for ALSA soundcard driver, with ncurses interface
assume_default_colors_sp (3x) - curses screen-pointer extension
attr_get (3x) - curses character and window attribute control routines
attr_off (3x) - curses character and window attribute control routines
attr_on (3x) - curses character and window attribute control routines
attr_set (3x) - curses character and window attribute control routines
attroff (3x) - curses character and window attribute control routines
attron (3x) - curses character and window attribute control routines
attrset (3x) - curses character and window attribute control routines
baudrate (3x) - curses environment query routines
baudrate_sp (3x) - curses screen-pointer extension
beep (3x) - curses bell and screen flash routines
beep_sp (3x) - curses screen-pointer extension
bkgd (3x) - curses window background manipulation routines
bkgdset (3x) - curses window background manipulation routines
bkgrnd (3x) - curses window complex background manipulation routines
bkgrndset (3x) - curses window complex background manipulation routines
boolcodes (3x) - curses terminfo global variables
boolfnames (3x) - curses terminfo global variables
boolnames (3x) - curses terminfo global variables
border (3x) - create curses borders, horizontal and vertical lines
border_set (3x) - create curses borders or lines using complex characters and renditions
bottom_panel (3x) - panel stack extension for curses
box (3x) - create curses borders, horizontal and vertical lines
box_set (3x) - create curses borders or lines using complex characters and renditions
can_change_color (3x) - curses color manipulation routines
can_change_color_sp (3x) - curses screen-pointer extension
cbreak (3x) - curses input options
cbreak_sp (3x) - curses screen-pointer extension
ccmake (1) - Curses Interface for CMake.
ceiling_panel (3x) - curses screen-pointer extension
cgdisk (8) - Curses-based GUID partition table (GPT) manipulator
chgat (3x) - curses character and window attribute control routines
clear (3x) - clear all or part of a curses window
clearok (3x) - curses output options
clrtobot (3x) - clear all or part of a curses window
clrtoeol (3x) - clear all or part of a curses window
color_content (3x) - curses color manipulation routines
color_content_sp (3x) - curses screen-pointer extension
COLOR_PAIR (3x) - curses color manipulation routines
COLOR_PAIRS (3x) - curses global variables
color_set (3x) - curses character and window attribute control routines
COLS (3x) - curses global variables
copywin (3x) - overlay and manipulate overlapped curses windows
cur_term (3x) - curses terminfo global variables
curs_add_wch (3x) - add a complex character and rendition to a curses window, then advance the cursor
curs_add_wchstr (3x) - add an array of complex characters (and attributes) to a curses window
curs_addch (3x) - add a character (with attributes) to a curses window, then advance the cursor
curs_addchstr (3x) - add a string of characters (and attributes) to a curses window
curs_addstr (3x) - add a string of characters to a curses window and advance cursor
curs_addwstr (3x) - add a string of wide characters to a curses window and advance cursor
curs_attr (3x) - curses character and window attribute control routines
curs_beep (3x) - curses bell and screen flash routines
curs_bkgd (3x) - curses window background manipulation routines
curs_bkgrnd (3x) - curses window complex background manipulation routines
curs_border (3x) - create curses borders, horizontal and vertical lines
curs_border_set (3x) - create curses borders or lines using complex characters and renditions
curs_clear (3x) - clear all or part of a curses window
curs_color (3x) - curses color manipulation routines
curs_delch (3x) - delete character under the cursor in a curses window
curs_deleteln (3x) - delete and insert lines in a curses window
curs_extend (3x) - miscellaneous curses extensions
curs_get_wch (3x) - get (or push back) a wide character from curses terminal keyboard
curs_get_wstr (3x) - get an array of wide characters from a curses terminal keyboard
curs_getch (3x) - get (or push back) characters from curses terminal keyboard
curs_getstr (3x) - accept character strings from curses terminal keyboard
curs_getyx (3x) - get curses cursor and window coordinates
curs_in_wchstr (3x) - get an array of complex characters and renditions from a curses window
curs_inch (3x) - get a character and attributes from a curses window
curs_inchstr (3x) - get a string of characters (and attributes) from a curses window
curs_initscr (3x) - curses screen initialization and manipulation routines
curs_inopts (3x) - curses input options
curs_ins_wstr (3x) - insert a wide-character string into a curses window
curs_insch (3x) - insert a character before cursor in a curses window
curs_insstr (3x) - insert string before cursor in a curses window
curs_instr (3x) - get a string of characters from a curses window
curs_inwstr (3x) - get a string of wchar_t characters from a curses window
curs_kernel (3x) - low-level curses routines
curs_legacy (3x) - get curses cursor and window coordinates, attributes
curs_memleaks (3x) - curses memory-leak checking
curs_mouse (3x) - mouse interface through curses
curs_move (3x) - move curses window cursor
curs_opaque (3x) - curses window properties
curs_outopts (3x) - curses output options
curs_overlay (3x) - overlay and manipulate overlapped curses windows
curs_pad (3x) - create and display curses pads
curs_printw (3x) - print formatted output in curses windows
curs_refresh (3x) - refresh curses windows and lines
curs_scanw (3x) - convert formatted input from a curses window
curs_scr_dump (3x) - read (write) a curses screen from (to) a file
curs_scroll (3x) - scroll a curses window
curs_set (3x) - low-level curses routines
curs_set_sp (3x) - curses screen-pointer extension
curs_slk (3x) - curses soft label routines
curs_sp_funcs (3x) - curses screen-pointer extension
curs_termattrs (3x) - curses environment query routines
curs_termcap (3x) - direct curses interface to the terminfo capability database
curs_terminfo (3x) - curses interfaces to terminfo database
curs_threads (3x) - curses thread support
curs_touch (3x) - curses refresh control routines
curs_trace (3x) - curses debugging routines
curs_util (3x) - miscellaneous curses utility routines
curs_variables (3x) - curses global variables
curs_window (3x) - create curses windows
curscr (3x) - curses global variables
curses_version (3x) - miscellaneous curses extensions
def_prog_mode (3x) - low-level curses routines
def_prog_mode_sp (3x) - curses screen-pointer extension
def_shell_mode (3x) - low-level curses routines
def_shell_mode_sp (3x) - curses screen-pointer extension
define_key_sp (3x) - curses screen-pointer extension
del_curterm (3x) - curses interfaces to terminfo database
del_curterm_sp (3x) - curses screen-pointer extension
del_panel (3x) - panel stack extension for curses
delay_output (3x) - miscellaneous curses utility routines
delay_output_sp (3x) - curses screen-pointer extension
delch (3x) - delete character under the cursor in a curses window
deleteln (3x) - delete and insert lines in a curses window
delscreen (3x) - curses screen initialization and manipulation routines
delwin (3x) - create curses windows
derwin (3x) - create curses windows
doupdate (3x) - refresh curses windows and lines
doupdate_sp (3x) - curses screen-pointer extension
dupwin (3x) - create curses windows
echo (3x) - curses input options
echo_sp (3x) - curses screen-pointer extension
echo_wchar (3x) - add a complex character and rendition to a curses window, then advance the cursor
echochar (3x) - add a character (with attributes) to a curses window, then advance the cursor
endwin (3x) - curses screen initialization and manipulation routines
endwin_sp (3x) - curses screen-pointer extension
erase (3x) - clear all or part of a curses window
erasechar (3x) - curses environment query routines
erasechar_sp (3x) - curses screen-pointer extension
erasewchar (3x) - curses environment query routines
ESCDELAY (3x) - curses global variables
filter (3x) - miscellaneous curses utility routines
filter_sp (3x) - curses screen-pointer extension
flash (3x) - curses bell and screen flash routines
flash_sp (3x) - curses screen-pointer extension
flushinp (3x) - miscellaneous curses utility routines
flushinp_sp (3x) - curses screen-pointer extension
form (3x) - curses extension for programming forms
get_escdelay (3x) - curses thread support
get_escdelay_sp (3x) - curses screen-pointer extension
get_wch (3x) - get (or push back) a wide character from curses terminal keyboard
get_wstr (3x) - get an array of wide characters from a curses terminal keyboard
getattrs (3x) - get curses cursor and window coordinates, attributes
getbegx (3x) - get curses cursor and window coordinates, attributes
getbegy (3x) - get curses cursor and window coordinates, attributes
getbegyx (3x) - get curses cursor and window coordinates
getbkgd (3x) - curses window background manipulation routines
getbkgrnd (3x) - curses window complex background manipulation routines
getch (3x) - get (or push back) characters from curses terminal keyboard
getcurx (3x) - get curses cursor and window coordinates, attributes
getcury (3x) - get curses cursor and window coordinates, attributes
getmaxx (3x) - get curses cursor and window coordinates, attributes
getmaxy (3x) - get curses cursor and window coordinates, attributes
getmaxyx (3x) - get curses cursor and window coordinates
getmouse (3x) - mouse interface through curses
getmouse_sp (3x) - curses screen-pointer extension
getn_wstr (3x) - get an array of wide characters from a curses terminal keyboard
getnstr (3x) - accept character strings from curses terminal keyboard
getparx (3x) - get curses cursor and window coordinates, attributes
getpary (3x) - get curses cursor and window coordinates, attributes
getparyx (3x) - get curses cursor and window coordinates
getstr (3x) - accept character strings from curses terminal keyboard
getsyx (3x) - low-level curses routines
getwin (3x) - miscellaneous curses utility routines
getwin_sp (3x) - curses screen-pointer extension
getyx (3x) - get curses cursor and window coordinates
ground_panel (3x) - curses screen-pointer extension
halfdelay (3x) - curses input options
halfdelay_sp (3x) - curses screen-pointer extension
has_colors (3x) - curses color manipulation routines
has_colors_sp (3x) - curses screen-pointer extension
has_ic (3x) - curses environment query routines
has_ic_sp (3x) - curses screen-pointer extension
has_il (3x) - curses environment query routines
has_il_sp (3x) - curses screen-pointer extension
has_key (3x) - get (or push back) characters from curses terminal keyboard
has_key_sp (3x) - curses screen-pointer extension
has_mouse (3x) - mouse interface through curses
has_mouse_sp (3x) - curses screen-pointer extension
hide_panel (3x) - panel stack extension for curses
hline (3x) - create curses borders, horizontal and vertical lines
hline_set (3x) - create curses borders or lines using complex characters and renditions
idcok (3x) - curses output options
idlok (3x) - curses output options
immedok (3x) - curses output options
in_wchnstr (3x) - get an array of complex characters and renditions from a curses window
in_wchstr (3x) - get an array of complex characters and renditions from a curses window
inch (3x) - get a character and attributes from a curses window
inchnstr (3x) - get a string of characters (and attributes) from a curses window
inchstr (3x) - get a string of characters (and attributes) from a curses window
init_color (3x) - curses color manipulation routines
init_color_sp (3x) - curses screen-pointer extension
init_pair (3x) - curses color manipulation routines
init_pair_sp (3x) - curses screen-pointer extension
initscr (3x) - curses screen initialization and manipulation routines
innstr (3x) - get a string of characters from a curses window
innwstr (3x) - get a string of wchar_t characters from a curses window
ins_nwstr (3x) - insert a wide-character string into a curses window
ins_wstr (3x) - insert a wide-character string into a curses window
insch (3x) - insert a character before cursor in a curses window
insdelln (3x) - delete and insert lines in a curses window
insertln (3x) - delete and insert lines in a curses window
insnstr (3x) - insert string before cursor in a curses window
insstr (3x) - insert string before cursor in a curses window
instr (3x) - get a string of characters from a curses window
intrflush (3x) - curses input options
intrflush_sp (3x) - curses screen-pointer extension
inwstr (3x) - get a string of wchar_t characters from a curses window
is_cleared (3x) - curses window properties
is_idcok (3x) - curses window properties
is_idlok (3x) - curses window properties
is_immedok (3x) - curses window properties
is_keypad (3x) - curses window properties
is_leaveok (3x) - curses window properties
is_linetouched (3x) - curses refresh control routines
is_nodelay (3x) - curses window properties
is_notimeout (3x) - curses window properties
is_pad (3x) - curses window properties
is_scrollok (3x) - curses window properties
is_subwin (3x) - curses window properties
is_syncok (3x) - curses window properties
is_term_resized (3x) - change the curses terminal size
is_term_resized_sp (3x) - curses screen-pointer extension
is_wintouched (3x) - curses refresh control routines
isendwin (3x) - curses screen initialization and manipulation routines
isendwin_sp (3x) - curses screen-pointer extension
key_defined_sp (3x) - curses screen-pointer extension
key_name (3x) - miscellaneous curses utility routines
keybound_sp (3x) - curses screen-pointer extension
keyname (3x) - miscellaneous curses utility routines
keyname_sp (3x) - curses screen-pointer extension
keyok_sp (3x) - curses screen-pointer extension
keypad (3x) - curses input options
killchar (3x) - curses environment query routines
killchar_sp (3x) - curses screen-pointer extension
killwchar (3x) - curses environment query routines
leaveok (3x) - curses output options
LINES (3x) - curses global variables
longname (3x) - curses environment query routines
mcprint_sp (3x) - curses screen-pointer extension
menu (3x) - curses extension for programming menus
meta (3x) - curses input options
mouse_trafo (3x) - mouse interface through curses
mouseinterval (3x) - mouse interface through curses
mouseinterval_sp (3x) - curses screen-pointer extension
mousemask (3x) - mouse interface through curses
mousemask_sp (3x) - curses screen-pointer extension
move (3x) - move curses window cursor
move_panel (3x) - panel stack extension for curses
mvadd_wch (3x) - add a complex character and rendition to a curses window, then advance the cursor
mvadd_wchnstr (3x) - add an array of complex characters (and attributes) to a curses window
mvadd_wchstr (3x) - add an array of complex characters (and attributes) to a curses window
mvaddch (3x) - add a character (with attributes) to a curses window, then advance the cursor
mvaddchnstr (3x) - add a string of characters (and attributes) to a curses window
mvaddchstr (3x) - add a string of characters (and attributes) to a curses window
mvaddnstr (3x) - add a string of characters to a curses window and advance cursor
mvaddnwstr (3x) - add a string of wide characters to a curses window and advance cursor
mvaddstr (3x) - add a string of characters to a curses window and advance cursor
mvaddwstr (3x) - add a string of wide characters to a curses window and advance cursor
mvchgat (3x) - curses character and window attribute control routines
mvcur (3x) - curses interfaces to terminfo database
mvcur_sp (3x) - curses screen-pointer extension
mvdelch (3x) - delete character under the cursor in a curses window
mvderwin (3x) - create curses windows
mvget_wch (3x) - get (or push back) a wide character from curses terminal keyboard
mvget_wstr (3x) - get an array of wide characters from a curses terminal keyboard
mvgetch (3x) - get (or push back) characters from curses terminal keyboard
mvgetn_wstr (3x) - get an array of wide characters from a curses terminal keyboard
mvgetnstr (3x) - accept character strings from curses terminal keyboard
mvgetstr (3x) - accept character strings from curses terminal keyboard
mvhline (3x) - create curses borders, horizontal and vertical lines
mvhline_set (3x) - create curses borders or lines using complex characters and renditions
mvin_wchnstr (3x) - get an array of complex characters and renditions from a curses window
mvin_wchstr (3x) - get an array of complex characters and renditions from a curses window
mvinch (3x) - get a character and attributes from a curses window
mvinchnstr (3x) - get a string of characters (and attributes) from a curses window
mvinchstr (3x) - get a string of characters (and attributes) from a curses window
mvinnstr (3x) - get a string of characters from a curses window
mvinnwstr (3x) - get a string of wchar_t characters from a curses window
mvins_nwstr (3x) - insert a wide-character string into a curses window
mvins_wstr (3x) - insert a wide-character string into a curses window
mvinsch (3x) - insert a character before cursor in a curses window
mvinsnstr (3x) - insert string before cursor in a curses window
mvinsstr (3x) - insert string before cursor in a curses window
mvinstr (3x) - get a string of characters from a curses window
mvinwstr (3x) - get a string of wchar_t characters from a curses window
mvprintw (3x) - print formatted output in curses windows
mvscanw (3x) - convert formatted input from a curses window
mvvline (3x) - create curses borders, horizontal and vertical lines
mvvline_set (3x) - create curses borders or lines using complex characters and renditions
mvwadd_wch (3x) - add a complex character and rendition to a curses window, then advance the cursor
mvwadd_wchnstr (3x) - add an array of complex characters (and attributes) to a curses window
mvwadd_wchstr (3x) - add an array of complex characters (and attributes) to a curses window
mvwaddch (3x) - add a character (with attributes) to a curses window, then advance the cursor
mvwaddchnstr (3x) - add a string of characters (and attributes) to a curses window
mvwaddchstr (3x) - add a string of characters (and attributes) to a curses window
mvwaddnstr (3x) - add a string of characters to a curses window and advance cursor
mvwaddnwstr (3x) - add a string of wide characters to a curses window and advance cursor
mvwaddstr (3x) - add a string of characters to a curses window and advance cursor
mvwaddwstr (3x) - add a string of wide characters to a curses window and advance cursor
mvwchgat (3x) - curses character and window attribute control routines
mvwdelch (3x) - delete character under the cursor in a curses window
mvwget_wch (3x) - get (or push back) a wide character from curses terminal keyboard
mvwget_wstr (3x) - get an array of wide characters from a curses terminal keyboard
mvwgetch (3x) - get (or push back) characters from curses terminal keyboard
mvwgetn_wstr (3x) - get an array of wide characters from a curses terminal keyboard
mvwgetnstr (3x) - accept character strings from curses terminal keyboard
mvwgetstr (3x) - accept character strings from curses terminal keyboard
mvwhline (3x) - create curses borders, horizontal and vertical lines
mvwhline_set (3x) - create curses borders or lines using complex characters and renditions
mvwin (3x) - create curses windows
mvwin_wchnstr (3x) - get an array of complex characters and renditions from a curses window
mvwin_wchstr (3x) - get an array of complex characters and renditions from a curses window
mvwinch (3x) - get a character and attributes from a curses window
mvwinchnstr (3x) - get a string of characters (and attributes) from a curses window
mvwinchstr (3x) - get a string of characters (and attributes) from a curses window
mvwinnstr (3x) - get a string of characters from a curses window
mvwinnwstr (3x) - get a string of wchar_t characters from a curses window
mvwins_nwstr (3x) - insert a wide-character string into a curses window
mvwins_wstr (3x) - insert a wide-character string into a curses window
mvwinsch (3x) - insert a character before cursor in a curses window
mvwinsnstr (3x) - insert string before cursor in a curses window
mvwinsstr (3x) - insert string before cursor in a curses window
mvwinstr (3x) - get a string of characters from a curses window
mvwinwstr (3x) - get a string of wchar_t characters from a curses window
mvwprintw (3x) - print formatted output in curses windows
mvwscanw (3x) - convert formatted input from a curses window
mvwvline (3x) - create curses borders, horizontal and vertical lines
mvwvline_set (3x) - create curses borders or lines using complex characters and renditions
napms (3x) - low-level curses routines
napms_sp (3x) - curses screen-pointer extension
ncurses (3x) - CRT screen handling and optimization package
ncursesw5-config (1) - helper script for ncurses libraries
new_form_sp (3x) - curses screen-pointer extension
new_menu_sp (3x) - curses screen-pointer extension
new_panel (3x) - panel stack extension for curses
new_prescr (3x) - curses screen-pointer extension
newpad (3x) - create and display curses pads
newpad_sp (3x) - curses screen-pointer extension
newscr (3x) - curses global variables
newterm (3x) - curses screen initialization and manipulation routines
newterm_sp (3x) - curses screen-pointer extension
newwin (3x) - create curses windows
newwin_sp (3x) - curses screen-pointer extension
nl (3x) - curses output options
nl_sp (3x) - curses screen-pointer extension
nocbreak (3x) - curses input options
nocbreak_sp (3x) - curses screen-pointer extension
nodelay (3x) - curses input options
noecho (3x) - curses input options
noecho_sp (3x) - curses screen-pointer extension
nofilter (3x) - miscellaneous curses utility routines
nofilter_sp (3x) - curses screen-pointer extension
nonl (3x) - curses output options
nonl_sp (3x) - curses screen-pointer extension
noqiflush (3x) - curses input options
noqiflush_sp (3x) - curses screen-pointer extension
noraw (3x) - curses input options
noraw_sp (3x) - curses screen-pointer extension
notimeout (3x) - curses input options
numcodes (3x) - curses terminfo global variables
numfnames (3x) - curses terminfo global variables
numnames (3x) - curses terminfo global variables
ospeed (3x) - direct curses interface to the terminfo capability database
overlay (3x) - overlay and manipulate overlapped curses windows
overwrite (3x) - overlay and manipulate overlapped curses windows
pair_content (3x) - curses color manipulation routines
pair_content_sp (3x) - curses screen-pointer extension
PAIR_NUMBER (3x) - curses character and window attribute control routines
panel (3x) - panel stack extension for curses
panel_above (3x) - panel stack extension for curses
panel_below (3x) - panel stack extension for curses
panel_hidden (3x) - panel stack extension for curses
panel_userptr (3x) - panel stack extension for curses
panel_window (3x) - panel stack extension for curses
PC (3x) - direct curses interface to the terminfo capability database
pecho_wchar (3x) - create and display curses pads
pechochar (3x) - create and display curses pads
pinfo (1) - curses based lynx-style info browser
pnoutrefresh (3x) - create and display curses pads
prefresh (3x) - create and display curses pads
printw (3x) - print formatted output in curses windows
putp (3x) - curses interfaces to terminfo database
putp_sp (3x) - curses screen-pointer extension
putwin (3x) - miscellaneous curses utility routines
qiflush (3x) - curses input options
qiflush_sp (3x) - curses screen-pointer extension
raw (3x) - curses input options
raw_sp (3x) - curses screen-pointer extension
redrawwin (3x) - refresh curses windows and lines
refresh (3x) - refresh curses windows and lines
replace_panel (3x) - panel stack extension for curses
reset_prog_mode (3x) - low-level curses routines
reset_prog_mode_sp (3x) - curses screen-pointer extension
reset_shell_mode (3x) - low-level curses routines
reset_shell_mode_sp (3x) - curses screen-pointer extension
resetty (3x) - low-level curses routines
resetty_sp (3x) - curses screen-pointer extension
resize_term (3x) - change the curses terminal size
resize_term_sp (3x) - curses screen-pointer extension
resizeterm (3x) - change the curses terminal size
resizeterm_sp (3x) - curses screen-pointer extension
restartterm (3x) - curses interfaces to terminfo database
restartterm_sp (3x) - curses screen-pointer extension
ripoffline (3x) - low-level curses routines
ripoffline_sp (3x) - curses screen-pointer extension
samba-regedit (8) - ncurses based tool to manage the Samba registry
savetty (3x) - low-level curses routines
savetty_sp (3x) - curses screen-pointer extension
scanw (3x) - convert formatted input from a curses window
scr_dump (3x) - read (write) a curses screen from (to) a file
scr_init (3x) - read (write) a curses screen from (to) a file
scr_init_sp (3x) - curses screen-pointer extension
scr_restore (3x) - read (write) a curses screen from (to) a file
scr_restore_sp (3x) - curses screen-pointer extension
scr_set (3x) - read (write) a curses screen from (to) a file
scr_set_sp (3x) - curses screen-pointer extension
scrl (3x) - scroll a curses window
scroll (3x) - scroll a curses window
scrollok (3x) - curses output options
set_curterm (3x) - curses interfaces to terminfo database
set_curterm_sp (3x) - curses screen-pointer extension
set_escdelay (3x) - curses thread support
set_escdelay_sp (3x) - curses screen-pointer extension
set_panel_userptr (3x) - panel stack extension for curses
set_tabsize (3x) - curses thread support
set_tabsize_sp (3x) - curses screen-pointer extension
set_term (3x) - curses screen initialization and manipulation routines
setscrreg (3x) - curses output options
setsyx (3x) - low-level curses routines
setterm (3x) - curses interfaces to terminfo database
setupterm (3x) - curses interfaces to terminfo database
show_panel (3x) - panel stack extension for curses
slk_attr (3x) - curses soft label routines
slk_attr_off (3x) - curses soft label routines
slk_attr_on (3x) - curses soft label routines
slk_attr_set (3x) - curses soft label routines
slk_attr_set_sp (3x) - curses screen-pointer extension
slk_attr_sp (3x) - curses screen-pointer extension
slk_attroff (3x) - curses soft label routines
slk_attroff_sp (3x) - curses screen-pointer extension
slk_attron (3x) - curses soft label routines
slk_attron_sp (3x) - curses screen-pointer extension
slk_attrset (3x) - curses soft label routines
slk_attrset_sp (3x) - curses screen-pointer extension
slk_clear (3x) - curses soft label routines
slk_clear_sp (3x) - curses screen-pointer extension
slk_color (3x) - curses soft label routines
slk_color_sp (3x) - curses screen-pointer extension
slk_init (3x) - curses soft label routines
slk_init_sp (3x) - curses screen-pointer extension
slk_label (3x) - curses soft label routines
slk_label_sp (3x) - curses screen-pointer extension
slk_noutrefresh (3x) - curses soft label routines
slk_noutrefresh_sp (3x) - curses screen-pointer extension
slk_refresh (3x) - curses soft label routines
slk_refresh_sp (3x) - curses screen-pointer extension
slk_restore (3x) - curses soft label routines
slk_restore_sp (3x) - curses screen-pointer extension
slk_set (3x) - curses soft label routines
slk_set_sp (3x) - curses screen-pointer extension
slk_touch (3x) - curses soft label routines
slk_touch_sp (3x) - curses screen-pointer extension
slk_wset (3x) - curses soft label routines
SP (3x) - curses terminfo global variables
standend (3x) - curses character and window attribute control routines
standout (3x) - curses character and window attribute control routines
start_color (3x) - curses color manipulation routines
start_color_sp (3x) - curses screen-pointer extension
stdscr (3x) - curses global variables
strcodes (3x) - curses terminfo global variables
strfnames (3x) - curses terminfo global variables
strnames (3x) - curses terminfo global variables
subpad (3x) - create and display curses pads
subwin (3x) - create curses windows
syncok (3x) - create curses windows
TABSIZE (3x) - curses global variables
term_attrs (3x) - curses environment query routines
term_attrs_sp (3x) - curses screen-pointer extension
term_variables (3x) - curses terminfo global variables
termattrs (3x) - curses environment query routines
termattrs_sp (3x) - curses screen-pointer extension
termname (3x) - curses environment query routines
termname_sp (3x) - curses screen-pointer extension
tgetent (3x) - direct curses interface to the terminfo capability database
tgetent_sp (3x) - curses screen-pointer extension
tgetflag (3x) - direct curses interface to the terminfo capability database
tgetflag_sp (3x) - curses screen-pointer extension
tgetnum (3x) - direct curses interface to the terminfo capability database
tgetnum_sp (3x) - curses screen-pointer extension
tgetstr (3x) - direct curses interface to the terminfo capability database
tgetstr_sp (3x) - curses screen-pointer extension
tgoto (3x) - direct curses interface to the terminfo capability database
tigetflag (3x) - curses interfaces to terminfo database
tigetflag_sp (3x) - curses screen-pointer extension
tigetnum (3x) - curses interfaces to terminfo database
tigetnum_sp (3x) - curses screen-pointer extension
tigetstr (3x) - curses interfaces to terminfo database
tigetstr_sp (3x) - curses screen-pointer extension
timeout (3x) - curses input options
tiparm (3x) - curses interfaces to terminfo database
top_panel (3x) - panel stack extension for curses
touchline (3x) - curses refresh control routines
touchwin (3x) - curses refresh control routines
tparm (3x) - curses interfaces to terminfo database
tputs (3x) - curses interfaces to terminfo database
tputs_sp (3x) - curses screen-pointer extension
trace (3x) - curses debugging routines
ttytype (3x) - curses terminfo global variables
typeahead (3x) - curses input options
typeahead_sp (3x) - curses screen-pointer extension
unctrl (3x) - miscellaneous curses utility routines
unctrl_sp (3x) - curses screen-pointer extension
unget_wch (3x) - get (or push back) a wide character from curses terminal keyboard
unget_wch_sp (3x) - curses screen-pointer extension
ungetch (3x) - get (or push back) characters from curses terminal keyboard
ungetch_sp (3x) - curses screen-pointer extension
ungetmouse (3x) - mouse interface through curses
ungetmouse_sp (3x) - curses screen-pointer extension
untouchwin (3x) - curses refresh control routines
UP (3x) - direct curses interface to the terminfo capability database
update_panels (3x) - panel stack extension for curses
update_panels_sp (3x) - curses screen-pointer extension
use_default_colors_sp (3x) - curses screen-pointer extension
use_env (3x) - miscellaneous curses utility routines
use_env_sp (3x) - curses screen-pointer extension
use_extended_names (3x) - miscellaneous curses extensions
use_legacy_coding_sp (3x) - curses screen-pointer extension
use_screen (3x) - curses thread support
use_tioctl (3x) - miscellaneous curses utility routines
use_window (3x) - curses thread support
vid_attr (3x) - curses interfaces to terminfo database
vid_attr_sp (3x) - curses screen-pointer extension
vid_puts (3x) - curses interfaces to terminfo database
vid_puts_sp (3x) - curses screen-pointer extension
vidattr (3x) - curses interfaces to terminfo database
vidattr_sp (3x) - curses screen-pointer extension
vidputs (3x) - curses interfaces to terminfo database
vidputs_sp (3x) - curses screen-pointer extension
vline (3x) - create curses borders, horizontal and vertical lines
vline_set (3x) - create curses borders or lines using complex characters and renditions
vw_printw (3x) - print formatted output in curses windows
vw_scanw (3x) - convert formatted input from a curses window
vwprintw (3x) - print formatted output in curses windows
vwscanw (3x) - convert formatted input from a curses window
wadd_wch (3x) - add a complex character and rendition to a curses window, then advance the cursor
wadd_wchnstr (3x) - add an array of complex characters (and attributes) to a curses window
wadd_wchstr (3x) - add an array of complex characters (and attributes) to a curses window
waddch (3x) - add a character (with attributes) to a curses window, then advance the cursor
waddchnstr (3x) - add a string of characters (and attributes) to a curses window
waddchstr (3x) - add a string of characters (and attributes) to a curses window
waddnstr (3x) - add a string of characters to a curses window and advance cursor
waddnwstr (3x) - add a string of wide characters to a curses window and advance cursor
waddstr (3x) - add a string of characters to a curses window and advance cursor
waddwstr (3x) - add a string of wide characters to a curses window and advance cursor
wattr_get (3x) - curses character and window attribute control routines
wattr_off (3x) - curses character and window attribute control routines
wattr_on (3x) - curses character and window attribute control routines
wattr_set (3x) - curses character and window attribute control routines
wattroff (3x) - curses character and window attribute control routines
wattron (3x) - curses character and window attribute control routines
wattrset (3x) - curses character and window attribute control routines
wbkgd (3x) - curses window background manipulation routines
wbkgdset (3x) - curses window background manipulation routines
wbkgrnd (3x) - curses window complex background manipulation routines
wbkgrndset (3x) - curses window complex background manipulation routines
wborder (3x) - create curses borders, horizontal and vertical lines
wborder_set (3x) - create curses borders or lines using complex characters and renditions
wchgat (3x) - curses character and window attribute control routines
wclear (3x) - clear all or part of a curses window
wclrtobot (3x) - clear all or part of a curses window
wclrtoeol (3x) - clear all or part of a curses window
wcolor_set (3x) - curses character and window attribute control routines
wcursyncup (3x) - create curses windows
wdelch (3x) - delete character under the cursor in a curses window
wdeleteln (3x) - delete and insert lines in a curses window
wecho_wchar (3x) - add a complex character and rendition to a curses window, then advance the cursor
wechochar (3x) - add a character (with attributes) to a curses window, then advance the cursor
wenclose (3x) - mouse interface through curses
werase (3x) - clear all or part of a curses window
wget_wch (3x) - get (or push back) a wide character from curses terminal keyboard
wget_wstr (3x) - get an array of wide characters from a curses terminal keyboard
wgetbkgrnd (3x) - curses window complex background manipulation routines
wgetch (3x) - get (or push back) characters from curses terminal keyboard
wgetn_wstr (3x) - get an array of wide characters from a curses terminal keyboard
wgetnstr (3x) - accept character strings from curses terminal keyboard
wgetparent (3x) - curses window properties
wgetscrreg (3x) - curses window properties
wgetstr (3x) - accept character strings from curses terminal keyboard
whline (3x) - create curses borders, horizontal and vertical lines
whline_set (3x) - create curses borders or lines using complex characters and renditions
win_wchnstr (3x) - get an array of complex characters and renditions from a curses window
win_wchstr (3x) - get an array of complex characters and renditions from a curses window
winch (3x) - get a character and attributes from a curses window
winchnstr (3x) - get a string of characters (and attributes) from a curses window
winchstr (3x) - get a string of characters (and attributes) from a curses window
winnstr (3x) - get a string of characters from a curses window
winnwstr (3x) - get a string of wchar_t characters from a curses window
wins_nwstr (3x) - insert a wide-character string into a curses window
wins_wstr (3x) - insert a wide-character string into a curses window
winsch (3x) - insert a character before cursor in a curses window
winsdelln (3x) - delete and insert lines in a curses window
winsertln (3x) - delete and insert lines in a curses window
winsnstr (3x) - insert string before cursor in a curses window
winsstr (3x) - insert string before cursor in a curses window
winstr (3x) - get a string of characters from a curses window
winwstr (3x) - get a string of wchar_t characters from a curses window
wmouse_trafo (3x) - mouse interface through curses
wmove (3x) - move curses window cursor
wnoutrefresh (3x) - refresh curses windows and lines
wprintw (3x) - print formatted output in curses windows
wredrawln (3x) - refresh curses windows and lines
wrefresh (3x) - refresh curses windows and lines
wresize (3x) - resize a curses window
wscanw (3x) - convert formatted input from a curses window
wscrl (3x) - scroll a curses window
wsetscrreg (3x) - curses output options
wstandend (3x) - curses character and window attribute control routines
wstandout (3x) - curses character and window attribute control routines
wsyncdown (3x) - create curses windows
wsyncup (3x) - create curses windows
wtimeout (3x) - curses input options
wtouchln (3x) - curses refresh control routines
wunctrl (3x) - miscellaneous curses utility routines
wunctrl_sp (3x) - curses screen-pointer extension
wvline (3x) - create curses borders, horizontal and vertical lines
wvline_set (3x) - create curses borders or lines using complex characters and renditions


Click here to read the complete article

devel / comp.lang.c++ / Re: Parsing multi-byte keystrokes

Pages:123456
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor