#include #include #include "utils.h" #include "keys.h" static struct termios original_term; void disable_term_echo() { struct termios new_setting; tcgetattr(0, &original_term); new_setting = original_term; new_setting.c_lflag &= ~ECHO; tcsetattr(0, TCSANOW, &new_setting); } void enable_term_echo() { tcsetattr(0, TCSANOW, &original_term); } void print_cfg_route(struct config *cfg) { } /* void print_pure(struct input_event *ie, struct config *cfg) */ /* { */ /* if (!cfg || !ie) { */ /* fprintf(stderr, "NULL.\n"); */ /* return; */ /* } */ /* if (!cfg->repeat && !cfg->show_shifted) { */ /* printf("%s\n", key_names[ie->code]); */ /* return; */ /* } */ /* if (cfg->repeat) { */ /* printf("%s\r", key_names[ie->code]); */ /* return; */ /* } */ /* /\* if (cfg->show_shifted) { *\/ */ /* /\* } *\/ */ /* } */ /* void print_with_time(struct input_event *ie, struct config *cfg) */ /* { */ /* if (!cfg || !ie) { */ /* fprintf(stderr, "NULL.\n"); */ /* return; */ /* } */ /* struct tm *tm_info; */ /* char time_buf[64]; */ /* time_t sec = (time_t)ie->input_event_sec; */ /* tm_info = localtime(&sec); */ /* strftime(time_buf, sizeof(time_buf), "%F %T", tm_info); */ /* printf("%s.%06ld: %s\n", time_buf, (long)ie->time.tv_usec, */ /* key_names[ie->code]); */ /* } */