Closed SafinaM closed 5 years ago
`void noecho() {
static struct termios oldt, newt;
int cnt = 0;
tcgetattr(STDIN_FILENO, &oldt);
newt = oldt;
newt.c_lflag &= ~(ICANON | ECHO);
tcsetattr(STDIN_FILENO, TCSANOW, &newt);
} ` I have used such call befor cycle and erase all keyboard garbage. Ok and thanks)
Hello! I wrote very simple app and use keyboard input. ` if (kbhit()) { ch = rlutil::getkey();
But in terminal I see such keyboard artefacts ^[[B ^[[D ^[[C. When I used ncurses library I could switch off them by noecho() method. But here I tried to clean screen by rlutil::cls(), tried to play with such flags. newt.c_lflag - is always is 0.
newt = oldt; newt.c_lflag &= ~(ICANON | ECHO); tcsetattr(STDIN_FILENO, TCSANOW, &newt);` Also I tried to use std::cout.flush() after each key-pressing. Nothing helps. Maybe you can help me, where I did mistake. Please.