From 291817c3f59c90378d5a9e01380d4117e1c7921e Mon Sep 17 00:00:00 2001 From: Furkan Sahin Date: Sat, 14 Sep 2024 21:22:21 -0500 Subject: config/bindings: Extend bindsym --to-code to additionally handle the case in which a given keysym maps to more than one keycode. Sometimes, a keysym can map to duplicate keycodes and `libxkbcommon` does not prohibit this. In that case, it makes sense to find all the keycodes that map to the keysym. - Merges translate_binding into translate_keysyms, simplify logic - Changes add_matching_keycodes to find ALL keycodes, not just last - Removes unncessary list_t* syms. It's only used to alias keys as "syms". No other purpose. This commit also introduces a recursive cartesian product calculator in order to handle any cases. `bindsym --to-code (M + .. + N)` s.t. Keysym M maps to keycodes { M_0 .. M_m } ... Keysym N maps to keycodes { N_0 .. N_n } results in || M x .. x N || bindings (cartesian product) --- include/sway/config.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/sway/config.h b/include/sway/config.h index bb770c6f..f09ca594 100644 --- a/include/sway/config.h +++ b/include/sway/config.h @@ -62,7 +62,6 @@ struct sway_binding { char *input; uint32_t flags; list_t *keys; // sorted in ascending order - list_t *syms; // sorted in ascending order; NULL if BINDING_CODE is not set uint32_t modifiers; xkb_layout_index_t group; char *command; -- cgit v1.2.3