From 8d635370a026a340b5da5bea4636088faae5f512 Mon Sep 17 00:00:00 2001 From: Michel-FK Date: Tue, 20 Apr 2021 09:54:36 +0200 Subject: [PATCH] release key when unmapping Signed-off-by: Michel-FK --- mapping_list.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mapping_list.c b/mapping_list.c index 2953318..d185e62 100644 --- a/mapping_list.c +++ b/mapping_list.c @@ -31,6 +31,7 @@ #include #include "mapping_list.h" #include "parse_config.h" +#include "uinput.h" //#define DEBUG_MAPPING_LIST #define ERROR_MAPPING_LIST @@ -133,7 +134,9 @@ void clear_mapping_list(mapping_list_t *list) if (tmp->value.command != NULL) { free(tmp->value.command); } - } + } else if (tmp->activated == true) { + sendKey(tmp->value.keycode, 0); + } free(tmp); } } @@ -233,6 +236,9 @@ bool remove_mapping(mapping_list_t *list, mapping_t *mapping) break; case MAPPING_KEY: + if (tmp->activated == true) { + sendKey(tmp->value.keycode, 0); + } break; default: