aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorVerdant <im@verdant.ee>2026-05-17 22:14:01 +0800
committerVerdant <im@verdant.ee>2026-05-17 22:14:01 +0800
commitf2b63eda01b41c82581c08a396ec28b14f14a4ad (patch)
treed852c7dfb3b9c4714486f0fcea9c5a5b0e91e342 /main.c
parent7b997e7ccfc3b33098868baf6d1835cc69f49fb4 (diff)
downloadkl-f2b63eda01b41c82581c08a396ec28b14f14a4ad.tar.gz
kl-f2b63eda01b41c82581c08a396ec28b14f14a4ad.zip
Modify config API name
enable_time -> time enable_key_counter -> key_counter
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 5 insertions, 5 deletions
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]++;