From dcd79065c87c69496ad4e2fa916053d8843a6c71 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Mon, 7 Feb 2022 19:41:33 +0100 Subject: wayland: unify key- and mouse-binding structs --- wayland.h | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'wayland.h') diff --git a/wayland.h b/wayland.h index fe77152f..d69ec9e0 100644 --- a/wayland.h +++ b/wayland.h @@ -101,23 +101,27 @@ enum bind_action_url { typedef tll(xkb_keycode_t) xkb_keycode_list_t; struct key_binding { - xkb_mod_mask_t mods; - xkb_keysym_t sym; - xkb_keycode_list_t key_codes; + enum config_key_binding_type type; int action; /* enum bind_action_* */ char **pipe_argv; -}; -typedef tll(struct key_binding) key_binding_list_t; -struct mouse_binding { - enum bind_action_normal action; xkb_mod_mask_t mods; - uint32_t button; - int count; - char **pipe_argv; + + union { + struct { + xkb_keysym_t sym; + xkb_keycode_list_t key_codes; + } k; + + struct { + uint32_t button; + int count; + } m; + }; + }; -typedef tll(struct mouse_binding) mouse_binding_list_t; +typedef tll(struct key_binding) key_binding_list_t; /* Mime-types we support when dealing with data offers (e.g. copy-paste, or DnD) */ enum data_offer_mime_type { @@ -254,7 +258,7 @@ struct seat { double aggregated[2]; bool have_discrete; - mouse_binding_list_t bindings; + key_binding_list_t bindings; } mouse; /* Clipboard */ -- cgit v1.3