aboutsummaryrefslogtreecommitdiff
path: root/wayland.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2022-02-09 16:52:37 +0000
committerDaniel Eklöf <daniel@ekloef.se>2022-02-09 16:52:37 +0000
commitee840a308aeb3a5ce00137da35dacebe2d9892ad (patch)
tree7b100acca663f7ff28f7c431e8c755610957000f /wayland.h
parentfoot.ini: add modeline so vim uses # comments instead of ; (diff)
parentconfig: rename csd.color.close -> quit (diff)
Merge branch 'refactor-key-bindings'
Diffstat (limited to 'wayland.h')
-rw-r--r--wayland.h35
1 files changed, 21 insertions, 14 deletions
diff --git a/wayland.h b/wayland.h
index c3e6bb6d..81109673 100644
--- a/wayland.h
+++ b/wayland.h
@@ -23,6 +23,7 @@
#include <fcft/fcft.h>
#include <tllist.h>
+#include "config.h"
#include "fdm.h"
/* Forward declarations */
@@ -100,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 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;
+ };
+
+ const struct binding_aux *aux;
+
};
-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 {
@@ -253,7 +258,7 @@ struct seat {
double aggregated[2];
bool have_discrete;
- mouse_binding_list_t bindings;
+ key_binding_list_t bindings;
} mouse;
/* Clipboard */
@@ -510,3 +515,5 @@ bool wayl_win_subsurface_new_with_custom_parent(
struct wl_window *win, struct wl_surface *parent,
struct wl_surf_subsurf *surf);
void wayl_win_subsurface_destroy(struct wl_surf_subsurf *surf);
+
+void wayl_bindings_reset(struct seat *seat);