aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2020-01-29 10:37:22 +0000
committerSean Young <sean@mess.org>2020-01-29 12:00:30 +0000
commitef1276b42de61fce3bc8e32f49ddf90887891b57 (patch)
treef14d052a91eb0bdcf4484f36194f823fc8ac0352
parenteb348adccff794734febe133d6b1bc26d232f379 (diff)
keytable: a bpf protocol can have parameters and no scancodes64bit-scancodes
Currently a protocol without scancodes does not get its parameters parsed. Signed-off-by: Sean Young <sean@mess.org>
-rw-r--r--utils/common/keymap.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/utils/common/keymap.c b/utils/common/keymap.c
index 15c31c76..a3c1349e 100644
--- a/utils/common/keymap.c
+++ b/utils/common/keymap.c
@@ -384,13 +384,6 @@ static error_t parse_toml_protocol(const char *fname, struct toml_table_t *proot
return EINVAL;
}
- scancodes = toml_table_in(proot, "scancodes");
- if (!scancodes) {
- if (verbose)
- fprintf(stderr, _("%s: no [protocols.scancodes] section\n"), fname);
- return 0;
- }
-
for (i = 0; (key = toml_key_in(proot, i)) != NULL; i++) {
int64_t value;
@@ -408,6 +401,13 @@ static error_t parse_toml_protocol(const char *fname, struct toml_table_t *proot
}
}
+ scancodes = toml_table_in(proot, "scancodes");
+ if (!scancodes) {
+ if (verbose)
+ fprintf(stderr, _("%s: no [protocols.scancodes] section\n"), fname);
+ return 0;
+ }
+
struct scancode_entry **next = &map->scancode;
i = 0;

Privacy Policy