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 <syslog.h>
#include "mapping_list.h" #include "mapping_list.h"
#include "parse_config.h" #include "parse_config.h"
#include "uinput.h"
//#define DEBUG_MAPPING_LIST //#define DEBUG_MAPPING_LIST
#define ERROR_MAPPING_LIST #define ERROR_MAPPING_LIST
@ -133,6 +134,8 @@ void clear_mapping_list(mapping_list_t *list)
if (tmp->value.command != NULL) { if (tmp->value.command != NULL) {
free(tmp->value.command); free(tmp->value.command);
} }
} else if (tmp->activated == true) {
sendKey(tmp->value.keycode, 0);
} }
free(tmp); free(tmp);
} }
@ -233,6 +236,9 @@ bool remove_mapping(mapping_list_t *list, mapping_t *mapping)
break; break;
case MAPPING_KEY: case MAPPING_KEY:
if (tmp->activated == true) {
sendKey(tmp->value.keycode, 0);
}
break; break;
default: default: