mirror of
https://github.com/mpv-player/mpv
synced 2025-02-21 15:27:00 +00:00
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:
parent
dde0189279
commit
1ba5dc84ca
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user