From b48c7536ab5f56cc548163b5200ed909996ea4fc Mon Sep 17 00:00:00 2001 From: Alessandro Bono Date: Thu, 26 Sep 2024 00:20:35 +0200 Subject: [PATCH] keybindings: Introduce resolve_special_key_combo() Special keys are going to be represent by up to two combos. This functions is able to handle them by adding all the keycodes that these combos resolve to. Special keys don't have modifiers, so there is no need to devirtualize them. Part-of: --- src/core/keybindings.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/core/keybindings.c b/src/core/keybindings.c index 7f304fcef..434fedce7 100644 --- a/src/core/keybindings.c +++ b/src/core/keybindings.c @@ -631,6 +631,22 @@ index_binding (MetaKeyBindingManager *keys, } } +static void +resolve_special_key_combo (MetaKeyBindingManager *keys, + MetaKeyCombo combos[2], + MetaResolvedKeyCombo *resolved_combo) +{ + resolved_key_combo_reset (resolved_combo); + + get_keycodes_for_combos (keys, + combos, + 2, + &resolved_combo->keycodes, + &resolved_combo->len); + + resolved_combo->mask = 0; +} + static void resolve_key_combo (MetaKeyBindingManager *keys, MetaKeyCombo *combo,