mirror of
https://github.com/celisej567/mcpe.git
synced 2025-12-31 17:49:17 +03:00
36 lines
727 B
C++
36 lines
727 B
C++
/*
|
|
* Copyright (c) 2014, Oculus VR, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
*/
|
|
|
|
#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
|