diff options
author | Mikkel Oscar Lyderik <mikkeloscar@gmail.com> | 2016-01-05 00:49:11 +0100 |
---|---|---|
committer | Mikkel Oscar Lyderik <mikkeloscar@gmail.com> | 2016-01-05 00:49:44 +0100 |
commit | 7727c9efbc105269befe06a5bb12d2019c52515e (patch) | |
tree | 14ae600a7fe97012c4a2a8bbd4e2d9abecc2e105 /sway/handlers.c | |
parent | f9b92783c5d8e20273acf7865f628d988249d7a2 (diff) |
Detect bar modifier pressed/released
Diffstat (limited to 'sway/handlers.c')
-rw-r--r-- | sway/handlers.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sway/handlers.c b/sway/handlers.c index 6c6d0e60..5e523468 100644 --- a/sway/handlers.c +++ b/sway/handlers.c @@ -387,6 +387,22 @@ static bool handle_key(wlc_handle view, uint32_t time, const struct wlc_modifier } } } + + // handle bar modifiers pressed/released + struct bar_config *bar; + for (i = 0; i < config->bars->length; ++i) { + bar = config->bars->items[i]; + switch (modifier_state_changed(modifiers->mods, bar->modifier)) { + case MOD_STATE_PRESSED: + sway_log(L_INFO, "pressed!!!"); + break; + case MOD_STATE_RELEASED: + sway_log(L_INFO, "released!!!"); + break; + } + } + // update modifiers state + modifiers_state_update(modifiers->mods); return EVENT_PASSTHROUGH; } |