input: support configuring drag_3fg from libinput (#10631)

This commit is contained in:
Ufuk Ustali
2025-06-06 16:47:15 +02:00
committed by GitHub
parent 456c820d52
commit 0ac3bef724
3 changed files with 13 additions and 0 deletions

View File

@@ -645,6 +645,12 @@ inline static const std::vector<SConfigOptionDescription> 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:

View File

@@ -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"});

View File

@@ -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<libinput_config_3fg_drag_state>(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<enum libinput_config_dwt_state>(g_pConfigManager->getDeviceInt(devname, "disable_while_typing", "input:touchpad:disable_while_typing") != 0);