From 8b55223b9d8cd30441aac653f9e0e7f8c3d40587 Mon Sep 17 00:00:00 2001 From: Vftdan Date: Sun, 18 Aug 2024 15:23:49 +0200 Subject: [PATCH] Small fixes - Fix parseable string of MODOP_TOGGLE - Actually set the configured namespace in nodes/evdev - Ensure non-negative payload in nodes/getchar --- modifiers.h | 2 +- nodes/evdev.c | 2 +- nodes/getchar.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modifiers.h b/modifiers.h index bde7be7..a26868a 100644 --- a/modifiers.h +++ b/modifiers.h @@ -199,7 +199,7 @@ modifier_operation_parse(const char* name) if (strcmp(name, "reset") == 0) { return MODOP_UNSET; } - if (strcmp(name, "togggle") == 0) { + if (strcmp(name, "toggle") == 0) { return MODOP_TOGGLE; } return -1; diff --git a/nodes/evdev.c b/nodes/evdev.c index f8aeeec..ce8891c 100644 --- a/nodes/evdev.c +++ b/nodes/evdev.c @@ -47,7 +47,7 @@ handle_io(EventPositionBase * self, int fd, bool is_output) monotime = absolute_time_sub_relative(realtime, realtime_adj); EventData data = { .code = { - .ns = 1, + .ns = node->namespace, .major = buf.type, .minor = buf.code, }, diff --git a/nodes/getchar.c b/nodes/getchar.c index a633651..7d6696d 100644 --- a/nodes/getchar.c +++ b/nodes/getchar.c @@ -29,7 +29,7 @@ handle_io(EventPositionBase * self, int fd, bool is_output) }, .ttl = 100, .priority = 10, - .payload = buf[0], + .payload = (unsigned char) buf[0], .modifiers = EMPTY_MODIFIER_SET, .time = get_current_time(), };