basic stream confuse.(charset level).

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • key9

    #1

    basic stream confuse.(charset level).

    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,eithe r 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.


Working...