aboutsummaryrefslogtreecommitdiff
path: root/config.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-12-11 20:04:27 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-12-11 20:04:27 +0000
commitfd26fadc2c10f6d1a7e3ff601e5a303c3234a47b (patch)
tree6110880cad53b51d99ec50243f1506991f08c28b /config.h
parenttest: meson: add fontconfig to ‘test-config’ binary (fixes PGO builds) (diff)
parentconfig: NOINLINE modifiers_to_str() (diff)
Merge branch 'config-refactor-and-verify-binding-collisions-after-load'
Diffstat (limited to 'config.h')
-rw-r--r--config.h36
1 files changed, 24 insertions, 12 deletions
diff --git a/config.h b/config.h
index 2ae3a2d5..84aee3ae 100644
--- a/config.h
+++ b/config.h
@@ -28,7 +28,7 @@ struct config_key_modifiers {
bool shift;
bool alt;
bool ctrl;
- bool meta;
+ bool super;
};
struct argv {
@@ -40,22 +40,34 @@ struct config_binding_pipe {
bool master_copy;
};
+enum config_key_binding_type {
+ KEY_BINDING,
+ MOUSE_BINDING,
+};
+
struct config_key_binding {
int action; /* One of the varios bind_action_* enums from wayland.h */
struct config_key_modifiers modifiers;
- xkb_keysym_t sym;
- struct config_binding_pipe pipe;
-};
-DEFINE_LIST(struct config_key_binding);
+ union {
+ /* Key bindings */
+ struct {
+ xkb_keysym_t sym;
+ } k;
+
+ /* Mouse bindings */
+ struct {
+ int button;
+ int count;
+ } m;
+ };
-struct config_mouse_binding {
- enum bind_action_normal action;
- struct config_key_modifiers modifiers;
- int button;
- int count;
struct config_binding_pipe pipe;
+
+ /* For error messages in collision handling */
+ const char *path;
+ int lineno;
};
-DEFINE_LIST(struct config_mouse_binding);
+DEFINE_LIST(struct config_key_binding);
typedef tll(char *) config_override_t;
@@ -199,7 +211,7 @@ struct config {
struct {
/* Bindings for "normal" mode */
struct config_key_binding_list key;
- struct config_mouse_binding_list mouse;
+ struct config_key_binding_list mouse;
/*
* Special modes