simulate windows' getch(), it works!!*/
| 96 | static struct termios oldt, newt; |
| 97 | /*simulate windows' getch(), it works!!*/ |
| 98 | static void set_stty(void) |
| 99 | { |
| 100 | /* get terminal input's attribute */ |
| 101 | tcgetattr(STDIN_FILENO, &oldt); |
| 102 | newt = oldt; |
| 103 | |
| 104 | /* set termios' local mode */ |
| 105 | newt.c_lflag &= ~(ECHO|ICANON); |
| 106 | tcsetattr(STDIN_FILENO, TCSANOW, &newt); |
| 107 | } |
| 108 | |
| 109 | void restore_stty(void) |
| 110 | { |
no test coverage detected