mirror of
https://git.stillkill.net/MinecraftLeak/Mc-cpp-Snapshot.git
synced 2026-10-22 13:22:19 +01:00
28 lines
447 B
C++
28 lines
447 B
C++
|
|
|
|
#if defined(_WIN32)
|
|
#include <conio.h> /* getche() */
|
|
#elif defined(__S3E__)
|
|
|
|
#else
|
|
|
|
#include "Getche.h"
|
|
|
|
char getche()
|
|
{
|
|
|
|
|
|
struct termios oldt,
|
|
newt;
|
|
char ch;
|
|
tcgetattr( STDIN_FILENO, &oldt );
|
|
newt = oldt;
|
|
newt.c_lflag &= ~( ICANON | ECHO );
|
|
tcsetattr( STDIN_FILENO, TCSANOW, &newt );
|
|
ch = getchar();
|
|
tcsetattr( STDIN_FILENO, TCSANOW, &oldt );
|
|
return ch;
|
|
|
|
}
|
|
#endif
|