summaryrefslogtreecommitdiffstats
path: root/include/input_state.h
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2016-01-06 07:26:54 -0500
committerLibravatar Drew DeVault <sir@cmpwn.com>2016-01-06 07:26:54 -0500
commit8f5de70c93b2afaab0dd7d384c58ff3d3007193c (patch)
tree4826eca48ec5d4d2b827477c74de7d500f39f0fa /include/input_state.h
parentFix whitespaces in cmake config (diff)
parentOnly send modifier event once for active modifiers (diff)
downloadsway-8f5de70c93b2afaab0dd7d384c58ff3d3007193c.tar.gz
sway-8f5de70c93b2afaab0dd7d384c58ff3d3007193c.tar.zst
sway-8f5de70c93b2afaab0dd7d384c58ff3d3007193c.zip
Merge pull request #434 from mikkeloscar/detect-modifier
Send IPC modifier event on bar_modifier up/down
Diffstat (limited to 'include/input_state.h')
-rw-r--r--include/input_state.h20
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 {
60 int mode; 60 int mode;
61} pointer_state; 61} pointer_state;
62 62
63enum modifier_state {
64 MOD_STATE_UNCHANGED = 0,
65 MOD_STATE_PRESSED = 1,
66 MOD_STATE_RELEASED = 2
67};
68
63void pointer_position_set(struct wlc_origin *new_origin, bool force_focus); 69void pointer_position_set(struct wlc_origin *new_origin, bool force_focus);
64void center_pointer_on(swayc_t *view); 70void center_pointer_on(swayc_t *view);
65 71
@@ -75,5 +81,19 @@ void pointer_mode_reset(void);
75 81
76void input_init(void); 82void input_init(void);
77 83
84/**
85 * Check if state of mod changed from current state to new_state.
86 *
87 * Returns MOD_STATE_UNCHANGED if the state didn't change, MOD_STATE_PRESSED if
88 * the state changed to pressed and MOD_STATE_RELEASED if the state changed to
89 * released.
90 */
91uint32_t modifier_state_changed(uint32_t new_state, uint32_t mod);
92
93/**
94 * Update the current modifiers state to new_state.
95 */
96void modifiers_state_update(uint32_t new_state);
97
78#endif 98#endif
79 99