C++ how to read a key without waiting for key grip "Enter" on Linux and Windows

299 Views Asked by At

Personally, I think the title is clear, if not, I’ll try to be more. Only managed solutions for Windows, for Linux does not. As you well know, the method "getchar()" reads only after keyboard key grip "Enter".

The conio.h library does not exist on Linux and ncurses or curses have to use a different command at build time, which I do not think very productive.

1

There are 1 best solutions below

3
On

fscanf on stdin would do it, I suppose.