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 /include | |
parent | f9b92783c5d8e20273acf7865f628d988249d7a2 (diff) | |
download | sway-7727c9efbc105269befe06a5bb12d2019c52515e.tar.xz |
Detect bar modifier pressed/released
Diffstat (limited to 'include')
-rw-r--r-- | include/input_state.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/input_state.h b/include/input_state.h index a1f238e1..79e27d91 100644 --- a/include/input_state.h +++ b/include/input_state.h @@ -60,6 +60,12 @@ extern struct pointer_state { int mode; } pointer_state; +enum modifier_state { + MOD_STATE_UNCHANGED = 0, + MOD_STATE_PRESSED = 1, + MOD_STATE_RELEASED = 2 +}; + void pointer_position_set(struct wlc_origin *new_origin, bool force_focus); void center_pointer_on(swayc_t *view); @@ -75,5 +81,19 @@ void pointer_mode_reset(void); void input_init(void); +/** + * Check if state of mod changed from current state to new_state. + * + * Returns MOD_STATE_UNCHANGED if the state didn't change, MOD_STATE_PRESSED if + * the state changed to pressed and MOD_STATE_RELEASED if the state changed to + * released. + */ +uint32_t modifier_state_changed(uint32_t new_state, uint32_t mod); + +/** + * Update the current modifiers state to new_state. + */ +void modifiers_state_update(uint32_t new_state); + #endif |