diff options
| author | Mathias Zhang <zsy3141592@163.com> | 2022-07-12 19:11:54 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-12 13:11:54 +0200 |
| commit | da83ef7b96fdee7396382712f9f2115ef4664666 (patch) | |
| tree | 47f514754a62e7b1bd99c80e9f0e9b9bf0b084af /src | |
| parent | 2d856ac4b08826ff83c42e97176f4f739442aefa (diff) | |
add config drag_lock for touchpad (#353)
* add config drag_lock for touchpad
* fix err
* Update ConfigManager.cpp
Diffstat (limited to 'src')
| -rw-r--r-- | src/config/ConfigManager.cpp | 2 | ||||
| -rw-r--r-- | src/managers/input/InputManager.cpp | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 077627aa..0243d2fe 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -106,6 +106,7 @@ void CConfigManager::setDefaultVars() { configValues["input:touchpad:clickfinger_behavior"].intValue = 0; configValues["input:touchpad:middle_button_emulation"].intValue = 0; configValues["input:touchpad:tap-to-click"].intValue = 1; + configValues["input:touchpad:drag_lock"].intValue = 0; configValues["gestures:workspace_swipe"].intValue = 0; configValues["gestures:workspace_swipe_distance"].intValue = 300; @@ -134,6 +135,7 @@ void CConfigManager::setDeviceDefaultVars(const std::string& dev) { cfgValues["clickfinger_behavior"].intValue = 0; cfgValues["middle_button_emulation"].intValue = 0; cfgValues["tap-to-click"].intValue = 1; + cfgValues["drag_lock"].intValue = 0; } void CConfigManager::init() { diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index fd716d58..2735e4e3 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -530,6 +530,11 @@ void CInputManager::newMouse(wlr_input_device* mouse, bool virt) { libinput_device_config_middle_emulation_set_enabled(LIBINPUTDEV, LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED); } + if ((HASCONFIG ? g_pConfigManager->getDeviceInt(PMOUSE->name, "drag_lock") : g_pConfigManager->getInt("input:touchpad:drag_lock")) == 0) + libinput_device_config_tap_set_drag_lock_enabled(LIBINPUTDEV, LIBINPUT_CONFIG_DRAG_LOCK_DISABLED); + else + libinput_device_config_tap_set_drag_lock_enabled(LIBINPUTDEV, LIBINPUT_CONFIG_DRAG_LOCK_ENABLED); + if (libinput_device_config_tap_get_finger_count(LIBINPUTDEV)) // this is for tapping (like on a laptop) if ((HASCONFIG ? g_pConfigManager->getDeviceInt(PMOUSE->name, "tap-to-click") : g_pConfigManager->getInt("input:touchpad:tap-to-click")) == 1) libinput_device_config_tap_set_enabled(LIBINPUTDEV, LIBINPUT_CONFIG_TAP_ENABLED); @@ -750,4 +755,4 @@ uint32_t CInputManager::accumulateModsFromAllKBs() { } return finalMask; -}
\ No newline at end of file +} |
