diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-07-26 23:34:03 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-07-26 23:34:03 +0200 |
| commit | 28046e9da039e689487923141c6a35e0eb9e31c0 (patch) | |
| tree | 026d6629c1f54356355a4491260eb725d65518ee /src/managers/KeybindManager.cpp | |
| parent | cc146f03441bd1512f42d768a321a3fad110671e (diff) | |
added binds:scroll_event_delay
Diffstat (limited to 'src/managers/KeybindManager.cpp')
| -rw-r--r-- | src/managers/KeybindManager.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 0548ee0e..dfcf47ef 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -34,6 +34,8 @@ CKeybindManager::CKeybindManager() { m_mDispatchers["focuswindow"] = focusWindow; m_mDispatchers["submap"] = setSubmap; m_mDispatchers["pass"] = pass; + + m_tScrollTimer.reset(); } void CKeybindManager::addKeybind(SKeybind kb) { @@ -139,6 +141,15 @@ bool CKeybindManager::onKeyEvent(wlr_keyboard_key_event* e, SKeyboard* pKeyboard bool CKeybindManager::onAxisEvent(wlr_pointer_axis_event* e) { const auto MODS = g_pInputManager->accumulateModsFromAllKBs(); + static auto *const PDELAY = &g_pConfigManager->getConfigValuePtr("binds:scroll_event_delay")->intValue; + + if (m_tScrollTimer.getMillis() < *PDELAY) { + m_tScrollTimer.reset(); + return true; // timer hasn't passed yet! + } + + m_tScrollTimer.reset(); + bool found = false; if (e->source == WLR_AXIS_SOURCE_WHEEL && e->orientation == WLR_AXIS_ORIENTATION_VERTICAL) { if (e->delta < 0) { |
