// printf("lflag: 0%o\n", tty.c_lflag);
if (enable)
- tty.c_lflag |= ECHO;
- else
- tty.c_lflag &= ~ECHO;
+ tty.c_lflag |= ECHO | ICANON;
+ else {
+ tty.c_lflag &= ~(ECHO | ICANON);
+ tty.c_cc[VMIN] = tty.c_cc[VTIME] = 0;
+ }
ret = tcsetattr(fd, TCSANOW, &tty);
if (ret != 0) {
}
FD_ZERO(&rfds);
+ FD_SET(STDIN_FILENO, &rfds);
for (i = 0; i < evdev_fd_cnt; i++)
FD_SET(evdev_fds[i], &rfds);
}
timeout = NULL;
+ /* sometihng form stdin? */
/* something from input devices? */
+ if (FD_ISSET(STDIN_FILENO, &rfds)) {
+ char c = 0;
+ ret = read(STDIN_FILENO, &c, 1);
+ if (ret <= 0) {
+ perror("read stdin");
+ break;
+ }
+
+ switch (c) {
+ case 'r':
+ enable_sent = 0;
+ break;
+ }
+ }
+
fixed_input_changed = 0;
for (i = 0; i < evdev_fd_cnt; i++) {
if (FD_ISSET(evdev_fds[i], &rfds)) {
continue;
}
enable_sent = 1;
+ frames_sent = 0;
}
if (tas_data == NULL && fixed_input_changed) {
memset(&pkt_out, 0, sizeof(pkt_out));