basic stream confuse.(charset level).

K

key9

Hi All

Scene:

I am making a toy for myself. with a "serial port" to control.
A console based program running on pc control it.(under c++)
On design, I met these c++ problem:


1.Is there anyway to read some combination-key like "ctrl+p"
"ctrl+shift+alt+k" on std::cin (directly/undirectly)?

2.when I hit "return" , I don't want a "eof" , I just need deal it as a
general key. How, on std::istream?

3.In unix , after I get a "fd"(a serial port, or a socket, maybe)
successful, I "listen" on it use a thread.
Can I treated every inputs as a "law integer"(I means, under mechanism
"std iostream")
(no these flags when met "eof" or something else?)
....

So I think I need a sample code something like "telnet server & client"
under c++.
I google it, almost all of them write under c.

Sorry for my knowledge,either c,or c++,also unix, I can not rewrite them.



My questions:

Q1: Is that source code exist? Better use mechanism "std iostream".

If !Q1,

Q2: where I can find these "charset" knowledge so I can treated everything
as "law integer"?
(the experience on MCU make me treated every thing as a scancode.)

Q3: what's more "c++" knowledge should I have to know ,when I want to
realize such a toy control program ???


New beginner.came from MCU.
Anyone be kindness to make me cut in fast?


your
key9.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top