aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/cursor.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r--sway/input/cursor.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index 731e82ad..5eb44412 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -1237,3 +1237,19 @@ uint32_t get_mouse_button(const char *name, char **error) {
1237 } 1237 }
1238 return button; 1238 return button;
1239} 1239}
1240
1241const char *get_mouse_button_name(uint32_t button) {
1242 const char *name = libevdev_event_code_get_name(EV_KEY, button);
1243 if (!name) {
1244 if (button == SWAY_SCROLL_UP) {
1245 name = "SWAY_SCROLL_UP";
1246 } else if (button == SWAY_SCROLL_DOWN) {
1247 name = "SWAY_SCROLL_DOWN";
1248 } else if (button == SWAY_SCROLL_LEFT) {
1249 name = "SWAY_SCROLL_LEFT";
1250 } else if (button == SWAY_SCROLL_RIGHT) {
1251 name = "SWAY_SCROLL_RIGHT";
1252 }
1253 }
1254 return name;
1255}