Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
console, input, noecho
Cross_Platform_Enthusiast last edited by
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.
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 with
QTextStreamin a portable manner:
QTextStream cin(stdin); QChar character; cin >> character;