diff --git a/src/config/ConfigDescriptions.hpp b/src/config/ConfigDescriptions.hpp index 982142848..1eff8c63c 100644 --- a/src/config/ConfigDescriptions.hpp +++ b/src/config/ConfigDescriptions.hpp @@ -645,6 +645,12 @@ inline static const std::vector CONFIG_OPTIONS = { .type = CONFIG_OPTION_BOOL, .data = SConfigOptionDescription::SBoolData{false}, }, + SConfigOptionDescription{ + .value = "input:touchpad:drag_3fg", + .description = "Three Finger Drag 0 -> disabled, 1 -> 3 finger, 2 -> 4 finger", + .type = CONFIG_OPTION_INT, + .data = SConfigOptionDescription::SRangeData{0, 0, 2}, + }, /* * input:touchdevice: diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 0632018c2..8dc06d77c 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -654,6 +654,7 @@ CConfigManager::CConfigManager() { registerConfigVar("input:touchpad:scroll_factor", {1.f}); registerConfigVar("input:touchpad:flip_x", Hyprlang::INT{0}); registerConfigVar("input:touchpad:flip_y", Hyprlang::INT{0}); + registerConfigVar("input:touchpad:drag_3fg", Hyprlang::INT{0}); registerConfigVar("input:touchdevice:transform", Hyprlang::INT{-1}); registerConfigVar("input:touchdevice:output", {"[[Auto]]"}); registerConfigVar("input:touchdevice:enabled", Hyprlang::INT{1}); @@ -789,6 +790,7 @@ CConfigManager::CConfigManager() { m_config->addSpecialConfigValue("device", "active_area_size", Hyprlang::VEC2{0, 0}); // only for tablets m_config->addSpecialConfigValue("device", "flip_x", Hyprlang::INT{0}); // only for touchpads m_config->addSpecialConfigValue("device", "flip_y", Hyprlang::INT{0}); // only for touchpads + m_config->addSpecialConfigValue("device", "drag_3fg", Hyprlang::INT{0}); // only for touchpads m_config->addSpecialConfigValue("device", "keybinds", Hyprlang::INT{1}); // enable/disable keybinds m_config->addSpecialCategory("monitorv2", {.key = "output"}); diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 70f92023b..007aaec09 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -1252,6 +1252,11 @@ void CInputManager::setPointerConfigs() { libinput_device_config_scroll_set_natural_scroll_enabled(LIBINPUTDEV, g_pConfigManager->getDeviceInt(devname, "natural_scroll", "input:natural_scroll")); } + if (libinput_device_config_3fg_drag_get_finger_count(LIBINPUTDEV) >= 3) { + const auto DRAG_3FG_STATE = static_cast(g_pConfigManager->getDeviceInt(devname, "drag_3fg", "input:touchpad:drag_3fg")); + libinput_device_config_3fg_drag_set_enabled(LIBINPUTDEV, DRAG_3FG_STATE); + } + if (libinput_device_config_dwt_is_available(LIBINPUTDEV)) { const auto DWT = static_cast(g_pConfigManager->getDeviceInt(devname, "disable_while_typing", "input:touchpad:disable_while_typing") != 0);