diff options
| author | verdant <im@verdant.ee> | 2026-05-24 13:03:35 +0800 |
|---|---|---|
| committer | verdant <im@verdant.ee> | 2026-05-24 13:03:35 +0800 |
| commit | 6e444c70add7ea8720d86559a4f13cdab5167be9 (patch) | |
| tree | 4271bf9558566e676fbc076ac3b4a737e9e19b88 | |
| parent | 6be13d03f9de1e8300ea8c308d377e7e4de7bbea (diff) | |
| download | kl-6e444c70add7ea8720d86559a4f13cdab5167be9.tar.gz kl-6e444c70add7ea8720d86559a4f13cdab5167be9.zip | |
chore: add comment
| -rw-r--r-- | utils.c | 43 | ||||
| -rw-r--r-- | utils.h | 6 |
2 files changed, 49 insertions, 0 deletions
@@ -1,5 +1,7 @@ #include <termios.h> +#include <stdio.h> #include "utils.h" +#include "keys.h" static struct termios original_term; @@ -17,3 +19,44 @@ 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]); */ +/* } */ @@ -1,7 +1,13 @@ #ifndef KL_UTILS_H #define KL_UTILS_H +#include <linux/input.h> +#include "config.h" + void disable_term_echo(); void enable_term_echo(); +/* void print_pure(struct input_event *ie, struct config *cfg); */ +/* void print_with_time(struct input_event *ie, struct config *cfg); */ + #endif |
