From dffacea831b6e7277920e885984d9c7c9b281d6c Mon Sep 17 00:00:00 2001 From: Mikkel Oscar Lyderik Date: Wed, 6 Jan 2016 16:59:54 +0100 Subject: Add function for getting list of modifier names. Get an array of modifier names from modifier masks. --- include/util.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/util.h b/include/util.h index 4bbb64c8..dc47e343 100644 --- a/include/util.h +++ b/include/util.h @@ -29,4 +29,11 @@ uint32_t get_modifier_mask_by_name(const char *name); */ const char *get_modifier_name_by_mask(uint32_t modifier); +/** + * Get an array of modifier names from modifier_masks + * + * Populates the names array and return the number of names added. + */ +int get_modifier_names(const char **names, uint32_t modifier_masks); + #endif -- cgit v1.2.3 From 32cd3f70eb4d9c55b65fa3cdd446c7a096cf4049 Mon Sep 17 00:00:00 2001 From: Mikkel Oscar Lyderik Date: Wed, 6 Jan 2016 17:01:08 +0100 Subject: Add function for duplication a sway_binding --- include/config.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/config.h b/include/config.h index 8220f804..1f2bbdd0 100644 --- a/include/config.h +++ b/include/config.h @@ -189,6 +189,7 @@ int sway_binding_cmp(const void *a, const void *b); int sway_binding_cmp_qsort(const void *a, const void *b); int sway_binding_cmp_keys(const void *a, const void *b); void free_sway_binding(struct sway_binding *sb); +struct sway_binding *sway_binding_dup(struct sway_binding *sb); int sway_mouse_binding_cmp(const void *a, const void *b); int sway_mouse_binding_cmp_qsort(const void *a, const void *b); -- cgit v1.2.3 From 6392abe35b32c66c642c25a7c6911021862d3413 Mon Sep 17 00:00:00 2001 From: Mikkel Oscar Lyderik Date: Wed, 6 Jan 2016 17:01:45 +0100 Subject: Implement IPC binding event (keyboard) This implements the IPC binding event for keyboard bindings. It is slightly different from the i3 implementation [1] since sway supports more than one non-modifier key in a binding. Thus the json interface has been changed from: { ... "symbol": "t", ... } to: { ... "symbols": [ "t" ], ... } [1] http://i3wm.org/docs/ipc.html#_binding_event --- include/ipc-server.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/ipc-server.h b/include/ipc-server.h index 47026bfd..96b7902f 100644 --- a/include/ipc-server.h +++ b/include/ipc-server.h @@ -21,6 +21,10 @@ void ipc_event_mode(const char *mode); * the name of that modifier. */ void ipc_event_modifier(uint32_t modifier, const char *state); +/** + * Send IPC keyboard binding event. + */ +void ipc_event_binding_keyboard(struct sway_binding *sb); const char *swayc_type_string(enum swayc_types type); #endif -- cgit v1.2.3