mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-16 04:23:49 -07:00
input: support configuring drag_3fg from libinput (#10631)
This commit is contained in:
@@ -645,6 +645,12 @@ inline static const std::vector<SConfigOptionDescription> CONFIG_OPTIONS = {
|
|||||||
.type = CONFIG_OPTION_BOOL,
|
.type = CONFIG_OPTION_BOOL,
|
||||||
.data = SConfigOptionDescription::SBoolData{false},
|
.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:
|
* input:touchdevice:
|
||||||
|
@@ -654,6 +654,7 @@ CConfigManager::CConfigManager() {
|
|||||||
registerConfigVar("input:touchpad:scroll_factor", {1.f});
|
registerConfigVar("input:touchpad:scroll_factor", {1.f});
|
||||||
registerConfigVar("input:touchpad:flip_x", Hyprlang::INT{0});
|
registerConfigVar("input:touchpad:flip_x", Hyprlang::INT{0});
|
||||||
registerConfigVar("input:touchpad:flip_y", 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:transform", Hyprlang::INT{-1});
|
||||||
registerConfigVar("input:touchdevice:output", {"[[Auto]]"});
|
registerConfigVar("input:touchdevice:output", {"[[Auto]]"});
|
||||||
registerConfigVar("input:touchdevice:enabled", Hyprlang::INT{1});
|
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", "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_x", Hyprlang::INT{0}); // only for touchpads
|
||||||
m_config->addSpecialConfigValue("device", "flip_y", 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->addSpecialConfigValue("device", "keybinds", Hyprlang::INT{1}); // enable/disable keybinds
|
||||||
|
|
||||||
m_config->addSpecialCategory("monitorv2", {.key = "output"});
|
m_config->addSpecialCategory("monitorv2", {.key = "output"});
|
||||||
|
@@ -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"));
|
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)) {
|
if (libinput_device_config_dwt_is_available(LIBINPUTDEV)) {
|
||||||
const auto DWT =
|
const auto DWT =
|
||||||
static_cast<enum libinput_config_dwt_state>(g_pConfigManager->getDeviceInt(devname, "disable_while_typing", "input:touchpad:disable_while_typing") != 0);
|
static_cast<enum libinput_config_dwt_state>(g_pConfigManager->getDeviceInt(devname, "disable_while_typing", "input:touchpad:disable_while_typing") != 0);
|
||||||
|
Reference in New Issue
Block a user