mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-29 20:05:59 +01:00
added binds:scroll_event_delay
This commit is contained in:
parent
cc146f0344
commit
28046e9da0
3 changed files with 14 additions and 0 deletions
|
@ -127,6 +127,7 @@ void CConfigManager::setDefaultVars() {
|
|||
configValues["input:touchpad:drag_lock"].intValue = 0;
|
||||
|
||||
configValues["binds:pass_mouse_when_bound"].intValue = 1;
|
||||
configValues["binds:scroll_event_delay"].intValue = 300;
|
||||
|
||||
configValues["gestures:workspace_swipe"].intValue = 0;
|
||||
configValues["gestures:workspace_swipe_fingers"].intValue = 3;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -60,6 +60,8 @@ private:
|
|||
uint32_t m_uTimeLastMs = 0;
|
||||
uint32_t m_uLastCode = 0;
|
||||
|
||||
CTimer m_tScrollTimer;
|
||||
|
||||
bool handleKeybinds(const uint32_t&, const std::string&, const xkb_keysym_t&, const int&, bool, uint32_t);
|
||||
|
||||
bool handleInternalKeybinds(xkb_keysym_t);
|
||||
|
|
Loading…
Reference in a new issue