Merge branch 'sway-xkb-ignore-non-keyboards-2'

Closes #54
This commit is contained in:
Daniel Eklöf 2021-06-04 23:28:47 +02:00
commit d95023adc8
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

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