diff options
| author | Grant Ammons <grant@grant.dev> | 2024-03-05 14:18:53 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-05 19:18:53 +0000 |
| commit | 0ee69058c447b91bd142523676b13c5af8685ba8 (patch) | |
| tree | 8d9711216da4e6c48cc446bc3aceb29c30047b4e /src/managers/input/InputManager.cpp | |
| parent | f8a081b56d09ec325ac485a0f055e541146486d3 (diff) | |
config: Add input:scroll_factor configuration (#4980)
* Allow for input:scroll_factor configuration
This PR will allow for a `scroll_factor` configuration within an `input`
block. The purpose is to control the scroll factor of external mice.
Closes #2574.
* clang-format
Diffstat (limited to 'src/managers/input/InputManager.cpp')
| -rw-r--r-- | src/managers/input/InputManager.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index b988df5e..f5ae1638 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -666,9 +666,10 @@ void CInputManager::processMouseDownKill(wlr_pointer_button_event* e) { } void CInputManager::onMouseWheel(wlr_pointer_axis_event* e) { - static auto PSCROLLFACTOR = CConfigValue<Hyprlang::FLOAT>("input:touchpad:scroll_factor"); + static auto PINPUTSCROLLFACTOR = CConfigValue<Hyprlang::FLOAT>("input:scroll_factor"); + static auto PTOUCHPADSCROLLFACTOR = CConfigValue<Hyprlang::FLOAT>("input:touchpad:scroll_factor"); - auto factor = (*PSCROLLFACTOR <= 0.f || e->source != WLR_AXIS_SOURCE_FINGER ? 1.f : *PSCROLLFACTOR); + auto factor = (*PTOUCHPADSCROLLFACTOR <= 0.f || e->source == WLR_AXIS_SOURCE_FINGER ? *PTOUCHPADSCROLLFACTOR : *PINPUTSCROLLFACTOR); const auto EMAP = std::unordered_map<std::string, std::any>{{"event", e}}; EMIT_HOOK_EVENT_CANCELLABLE("mouseAxis", EMAP); |
