wayland: support multiple modifiers

Oversight when the modifier checking was split out to a separate
function. Instead of immediately returning on a match, be sure to loop
through all modifiers and catch every single one that is pressed before
we return them.
This commit is contained in:
Dudemanguy 2020-12-20 10:53:29 -06:00
parent dde0189279
commit 1ba5dc84ca
1 changed files with 4 additions and 2 deletions

View File

@ -141,14 +141,16 @@ static int get_mods(struct vo_wayland_state *wl)
MP_KEY_MODIFIER_META,
};
int modifiers = 0;
for (int n = 0; n < MP_ARRAY_SIZE(mods); n++) {
xkb_mod_index_t index = xkb_keymap_mod_get_index(wl->xkb_keymap, mod_names[n]);
if (!xkb_state_mod_index_is_consumed(wl->xkb_state, wl->keyboard_code, index)
&& xkb_state_mod_index_is_active(wl->xkb_state, index,
XKB_STATE_MODS_DEPRESSED))
return mods[n];
modifiers |= mods[n];
}
return 0;
return modifiers;
}
static void pointer_handle_enter(void *data, struct wl_pointer *pointer,