From 14a2de0d0e0565ff889bcb1f5f803421a05cffc1 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Thu, 23 Feb 2023 13:55:27 +0000 Subject: [PATCH] add mouse_left _right --- src/managers/KeybindManager.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index efeb2a07..c58ae7b6 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -258,16 +258,20 @@ bool CKeybindManager::onAxisEvent(wlr_pointer_axis_event* e) { bool found = false; if (e->source == WLR_AXIS_SOURCE_WHEEL && e->orientation == WLR_AXIS_ORIENTATION_VERTICAL) { - if (e->delta < 0) { + if (e->delta < 0) found = handleKeybinds(MODS, "mouse_down", 0, 0, true, 0); - } else { + else found = handleKeybinds(MODS, "mouse_up", 0, 0, true, 0); - } - - if (found) - shadowKeybinds(); + } else if (e->source == WLR_AXIS_SOURCE_WHEEL && e->orientation == WLR_AXIS_ORIENTATION_HORIZONTAL) { + if (e->delta < 0) + found = handleKeybinds(MODS, "mouse_left", 0, 0, true, 0); + else + found = handleKeybinds(MODS, "mouse_right", 0, 0, true, 0); } + if (found) + shadowKeybinds(); + return !found; }