aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/input/cursor.h
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2018-12-28 13:48:09 -0500
committerLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-01-09 11:29:04 -0500
commit6f6a9af60ec98a6f18f1163317dee74b88328dab (patch)
treecd174b6d0e549a1142444c6f00100442166cfa3f /include/sway/input/cursor.h
parentReset container dimensions when moving into workspace from direction (diff)
downloadsway-6f6a9af60ec98a6f18f1163317dee74b88328dab.tar.gz
sway-6f6a9af60ec98a6f18f1163317dee74b88328dab.tar.zst
sway-6f6a9af60ec98a6f18f1163317dee74b88328dab.zip
Add helpers for improved mouse button parsing
The following helper functions have been added to aid with parsing mouse buttons from a string: 1. `get_mouse_bindsym`: attempts to parse the string as an x11 button (button[1-9]) or as an event name (ex BTN_LEFT or BTN_SIDE) 2. `get_mouse_bindcode`: attempts to parse the string as an event code and validates that the event code is a button (starts with `BTN_`). 3. `get_mouse_button`: this is a conveniency function for callers that do not care whether a bindsym or bindcode are used and attempts to parse the string as a bindsym and then bindcode. None of these functions are used in this commit. The sole purpose of this commit is to make the larger set more granular and easier to review/manipulate. There will be a series of commits following this one that will modify any command which uses a mouse button to use these helpers.
Diffstat (limited to 'include/sway/input/cursor.h')
-rw-r--r--include/sway/input/cursor.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/sway/input/cursor.h b/include/sway/input/cursor.h
index 22e278b0..4636bf6b 100644
--- a/include/sway/input/cursor.h
+++ b/include/sway/input/cursor.h
@@ -86,4 +86,12 @@ void cursor_warp_to_container(struct sway_cursor *cursor,
86 86
87void cursor_warp_to_workspace(struct sway_cursor *cursor, 87void cursor_warp_to_workspace(struct sway_cursor *cursor,
88 struct sway_workspace *workspace); 88 struct sway_workspace *workspace);
89
90uint32_t get_mouse_bindsym(const char *name, char **error);
91
92uint32_t get_mouse_bindcode(const char *name, char **error);
93
94// Considers both bindsym and bindcode
95uint32_t get_mouse_button(const char *name, char **error);
96
89#endif 97#endif