chore: изменения в коде шаблона
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <termios.h>
|
||||
#include <time.h>
|
||||
|
||||
/* Use this variable to remember original terminal attributes. */
|
||||
|
||||
@ -32,7 +33,8 @@ void set_input_mode()
|
||||
/* Set the funny terminal modes. */
|
||||
tcgetattr (STDIN_FILENO, &tattr);
|
||||
tattr.c_lflag &= ~(ICANON|ECHO); /* Clear ICANON and ECHO. */
|
||||
tattr.c_cc[VMIN] = 1;
|
||||
tattr.c_cc[VMIN] = 0;
|
||||
tattr.c_cc[VTIME] = 0;
|
||||
tcsetattr (STDIN_FILENO, TCSAFLUSH, &tattr);
|
||||
}
|
||||
|
||||
@ -52,10 +54,10 @@ char isKeyPressed()
|
||||
return 0;
|
||||
}
|
||||
|
||||
//int main()
|
||||
//{
|
||||
// set_input_mode();
|
||||
// while (isKeyPressed() == 0) {}
|
||||
// printf("ok");
|
||||
// reset_input_mode();
|
||||
//}
|
||||
int main()
|
||||
{
|
||||
set_input_mode();
|
||||
while (isKeyPressed() == 0) {printf("hell\n");}
|
||||
printf("ok\n");
|
||||
reset_input_mode();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user