Код: Выделить всё
#include
#include
#include
using namespace std;
char getKeyPress() {
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;
}
int main() {
cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79215225/how-can-i-detect-if-multiple-keyboard-keys-are-being-pressed-at-the-same-time-in[/url]
Мобильная версия