release key when unmapping

Signed-off-by: Michel-FK <michel.stempin@funkey-project.com>
This commit is contained in:
Michel-FK 2021-04-20 09:54:36 +02:00
parent e74f6883cc
commit 8d635370a0

View File

@ -31,6 +31,7 @@
#include <syslog.h>
#include "mapping_list.h"
#include "parse_config.h"
#include "uinput.h"
//#define DEBUG_MAPPING_LIST
#define ERROR_MAPPING_LIST
@ -133,6 +134,8 @@ 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: