keytable: provide configuration for empty keymap
PATCH 1/1 keytable: provide configuration for empty keymap
The lirc documentation contains some drastic measures for disabling in-kernel decoding. Provide a simpler method of disabling kernel
decoding: simply set /etc/rc_maps.cfg to:
* * empty.toml
Signed-off-by Sean Young <[email protected]>
--- utils/keytable/keytable.c | 23 ++++++++----------- .../keytable/rc_keymaps_userspace/empty.toml | 2 ++ 2 files changed, 12 insertions(+), 13 deletions(-) create mode 100644 utils/keytable/rc_keymaps_userspace/empty.toml
utils/keytable/keytable.c +10 -13
@@ -382,14 +382,16 @@ static int add_keymap(struct keymap *map, const char *fname) protocol =parse_sysfs_protocol (map->protocol, false);if (protocol ==SYSFS_INVALID ) { -struct bpf_protocol *b; - - b =malloc (sizeof (*b)); - b->name =strdup (map->protocol); - b->param = map->param; -/* steal param */ - map->param =NULL ; -add_bpf_protocol (b); +if (strcmp (map->protocol,"none" )) { +struct bpf_protocol *b; + + b =malloc (sizeof (*b)); + b->name =strdup (map->protocol); + b->param = map->param; +/* steal param */ + map->param =NULL ; +add_bpf_protocol (b); + } }else { ch_proto |= protocol; }
@@ -2105,11 +2107,6 @@ int main(int argc, char *argv[]) }add_keymap (map, fname);free_keymap (map); -if (!keytable) { -fprintf (stderr,_ ("Empty keymap %s\n" ), fname); -free (fname); -return -1 ; - }free (fname); clear =1 ; matches++;
utils/keytable/rc_keymaps_userspace/empty.toml new file +2 -0
@@ -0,0 +1,2 @@ +[[protocols]] +protocol = "none"
Signature · 1 line
2.37.3