From c20c63b677c03b17441f0d135b5325e23d65f38d Mon Sep 17 00:00:00 2001 From: Mikkel Oscar Lyderik Date: Tue, 5 Jan 2016 02:20:20 +0100 Subject: Send IPC modifier event on bar_modifier up/down Detects when a bar modifier key is pressed/released and sends a modifier IPC event to any listeners (usually swaybars). This way a swaybar can listen on the modifier event and hide/show the bar accordingly (not implemented yet) The modifier event looks like this: { "change": "pressed", // or released "modifier": "Mod4" } --- include/ipc-server.h | 6 ++++++ include/ipc.h | 1 + 2 files changed, 7 insertions(+) (limited to 'include') diff --git a/include/ipc-server.h b/include/ipc-server.h index 04975093..47026bfd 100644 --- a/include/ipc-server.h +++ b/include/ipc-server.h @@ -15,6 +15,12 @@ void ipc_event_barconfig_update(struct bar_config *bar); * Send IPC mode event to all listening clients */ void ipc_event_mode(const char *mode); +/** + * Sends an IPC modifier event to all listening clients. The modifier event + * includes a key 'change' with the value of state and a key 'modifier' with + * the name of that modifier. + */ +void ipc_event_modifier(uint32_t modifier, const char *state); const char *swayc_type_string(enum swayc_types type); #endif diff --git a/include/ipc.h b/include/ipc.h index e0b3b736..56593529 100644 --- a/include/ipc.h +++ b/include/ipc.h @@ -17,6 +17,7 @@ enum ipc_command_type { IPC_EVENT_WINDOW = (1 << 31 | 3), IPC_EVENT_BARCONFIG_UPDATE = (1 << 31 | 4), IPC_EVENT_BINDING = (1 << 31 | 5), + IPC_EVENT_MODIFIER = (1 << 31 | 6), IPC_SWAY_GET_PIXELS = 0x81 }; -- cgit v1.2.3