aboutsummaryrefslogtreecommitdiff
path: root/config.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-02-08 17:57:17 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-02-08 17:57:17 +0000
commit79e054faff0d6d49d44ef0c1c052387eb66581d0 (patch)
tree8bcd3684097661804bd41d4aca4df5c268c4e1fc /config.h
parentMerge branch 'url-parser-recognize-percent' (diff)
parentkey-bindings: refactor: use a single type for all key bindings (diff)
Merge branch 'refactor-key-bindings'
Diffstat (limited to 'config.h')
-rw-r--r--config.h37
1 files changed, 12 insertions, 25 deletions
diff --git a/config.h b/config.h
index 5ae70ae3..68a13434 100644
--- a/config.h
+++ b/config.h
@@ -25,39 +25,26 @@ struct config_key_modifiers {
bool meta;
};
-struct config_key_binding_normal {
- enum bind_action_normal action;
- struct config_key_modifiers modifiers;
- xkb_keysym_t sym;
- struct {
- char *cmd;
- char **argv;
- bool master_copy;
- } pipe;
-};
-
-struct config_key_binding_search {
- enum bind_action_search action;
- struct config_key_modifiers modifiers;
- xkb_keysym_t sym;
+struct config_binding_pipe {
+ char *cmd;
+ char **argv;
+ bool master_copy;
};
-struct config_key_binding_url {
- enum bind_action_url action;
+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;
};
+typedef tll(struct config_key_binding) config_key_binding_list_t;
struct config_mouse_binding {
enum bind_action_normal action;
struct config_key_modifiers modifiers;
int button;
int count;
- struct {
- char *cmd;
- char **argv;
- bool master_copy;
- } pipe;
+ struct config_binding_pipe pipe;
};
/* If px != 0 then px is valid, otherwise pt is valid */
@@ -169,7 +156,7 @@ struct config {
struct {
/* Bindings for "normal" mode */
- tll(struct config_key_binding_normal) key;
+ config_key_binding_list_t key;
tll(struct config_mouse_binding) mouse;
/*
@@ -178,10 +165,10 @@ struct config {
/* While searching (not - action to *start* a search is in the
* 'key' bindings above */
- tll(struct config_key_binding_search) search;
+ config_key_binding_list_t search;
/* While showing URL jump labels */
- tll(struct config_key_binding_url) url;
+ config_key_binding_list_t url;
} bindings;
struct {