module/sway-xkb: ignore non-keyboard inputs

Closes #51
This commit is contained in:
Daniel Eklöf 2021-05-26 21:11:53 +02:00
parent 85ce6dc8ef
commit 463f1ea75d
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 11 additions and 0 deletions

View file

@ -99,6 +99,15 @@ handle_input_reply(int type, const struct json_object *json, void *_mod)
return false;
const char *id = json_object_get_string(identifier);
struct json_object *type;
if (!json_object_object_get_ex(obj, "type", &type))
return false;
if (strcmp(json_object_get_string(type), "keyboard") != 0) {
LOG_DBG("ignoring non-keyboard input '%s'", id);
continue;
}
struct input *input = NULL;
for (size_t i = 0; i < m->num_inputs; i++) {
struct input *maybe_input = &m->inputs[i];