From d7e7a292613a4f20218074ff8299dff099a80098 Mon Sep 17 00:00:00 2001 From: nyx Date: Mon, 3 Mar 2025 15:56:01 -0500 Subject: input: add flip_x and flip_y for touchpad (#9481) --- src/config/ConfigDescriptions.hpp | 12 ++++++++++++ src/config/ConfigManager.cpp | 4 ++++ 2 files changed, 16 insertions(+) (limited to 'src/config') diff --git a/src/config/ConfigDescriptions.hpp b/src/config/ConfigDescriptions.hpp index 842df3ef..7ed0d03c 100644 --- a/src/config/ConfigDescriptions.hpp +++ b/src/config/ConfigDescriptions.hpp @@ -608,6 +608,18 @@ inline static const std::vector CONFIG_OPTIONS = { .type = CONFIG_OPTION_BOOL, .data = SConfigOptionDescription::SBoolData{false}, }, + SConfigOptionDescription{ + .value = "input:touchpad:flip_x", + .description = "Inverts the horizontal movement of the touchpad", + .type = CONFIG_OPTION_BOOL, + .data = SConfigOptionDescription::SBoolData{false}, + }, + SConfigOptionDescription{ + .value = "input:touchpad:flip_y", + .description = "Inverts the vertical movement of the touchpad", + .type = CONFIG_OPTION_BOOL, + .data = SConfigOptionDescription::SBoolData{false}, + }, /* * input:touchdevice: diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 2547992b..f85010af 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -603,6 +603,8 @@ CConfigManager::CConfigManager() { registerConfigVar("input:touchpad:tap-and-drag", Hyprlang::INT{1}); registerConfigVar("input:touchpad:drag_lock", Hyprlang::INT{0}); 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:touchdevice:transform", Hyprlang::INT{0}); registerConfigVar("input:touchdevice:output", {"[[Auto]]"}); registerConfigVar("input:touchdevice:enabled", Hyprlang::INT{1}); @@ -731,6 +733,8 @@ CConfigManager::CConfigManager() { m_pConfig->addSpecialConfigValue("device", "relative_input", Hyprlang::INT{0}); // only for tablets m_pConfig->addSpecialConfigValue("device", "active_area_position", Hyprlang::VEC2{0, 0}); // only for tablets m_pConfig->addSpecialConfigValue("device", "active_area_size", Hyprlang::VEC2{0, 0}); // only for tablets + m_pConfig->addSpecialConfigValue("device", "flip_x", Hyprlang::INT{0}); // only for touchpads + m_pConfig->addSpecialConfigValue("device", "flip_y", Hyprlang::INT{0}); // only for touchpads // keywords m_pConfig->registerHandler(&::handleExec, "exec", {false}); -- cgit v1.2.3