console, input, noecho
-
Does Qt provide a portable way to read a character from console without waiting for "Enter" and with no echo? On Windows it's "_getch()", but on Linux you have to configure stdin using termios.h -> tcsetattr(). I hear on Mac it's something else...
Thanks in advance. -
Does Qt provide a portable way to read a character from console without waiting for "Enter" and with no echo? On Windows it's "_getch()", but on Linux you have to configure stdin using termios.h -> tcsetattr(). I hear on Mac it's something else...
Thanks in advance.@Cross_Platform_Enthusiast
Hello,
I don't know about the "echo", I don't think Qt provides a way to configure the terminal (it'd go way beyond scope), however you can read from the standard input withQTextStream
in a portable manner:QTextStream cin(stdin); QChar character; cin >> character;
Kind regards.