From f2b63eda01b41c82581c08a396ec28b14f14a4ad Mon Sep 17 00:00:00 2001 From: Verdant Date: Sun, 17 May 2026 22:14:01 +0800 Subject: Modify config API name enable_time -> time enable_key_counter -> key_counter --- main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index e29f192..229e91d 100644 --- a/main.c +++ b/main.c @@ -278,29 +278,29 @@ int main(int argc, char ** argv) { } if (fd == -1 && errno == ENOENT) { - printf("No such file or directory: %s\n", cfg -> device); + printf("Invalid device, please check your config file.\n"); return -1; } init_key_names(); - void( * fp)(struct input_event * ie) = (cfg -> enable_time == true) ? print_with_time : print_pure; + void( * fp)(struct input_event * ie) = (cfg -> time == true) ? print_with_time : print_pure; while (1) { read(fd, & ie, sizeof(ie)); if (ie.type == EV_KEY) { if (ie.value == KEY_PRESS) { - if (line_lock != -1 && !cfg -> enable_time) printf("\n"); + if (line_lock != -1 && !cfg -> time) printf("\n"); repeat_counters[ie.code] = 1; line_lock = ie.code; fp(&ie); } if (ie.value == KEY_REPEAT) { - if (cfg->enable_time) { - if (cfg->enable_time) printf("\r\033[K"); + if (cfg->time) { + if (cfg->time) printf("\r\033[K"); } line_lock = ie.code; repeat_counters[ie.code]++; -- cgit v1.2.3