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-30 09:27:40 +0000
commitc4a62f26c5c3ecd856ca10cf2f0d35d100283d7f (patch)
tree379e4e67dfb6efb0fbae515bb2b46852612ad7d4
parent5af0730d06247a2de487abf2e00e70b156f1fb82 (diff)
keytable: a bpf protocol can have parameters and no 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 6ca33745..df953d7c 100644
--- a/utils/common/keymap.c
+++ b/utils/common/keymap.c
@@ -389,13 +389,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;
@@ -413,6 +406,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