mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-23 20:09:46 +03:00
* Initial commit.
:)
This commit is contained in:
35
thirdparty/raknet/Getche.cpp
vendored
Normal file
35
thirdparty/raknet/Getche.cpp
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* 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
|
||||
Reference in New Issue
Block a user