diff options
author | Mihai Fufezan <[email protected]> | 2023-02-05 16:17:23 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2023-02-05 14:17:23 +0000 |
commit | 53945cff3184cfdff3ed978e072b4ed65e3b2ec5 (patch) | |
tree | 5d7d5654b49c9aeb22053d2e25ece34bd45f9868 | |
parent | 760b37f71d200643d3e267472e5cc290d38d1a53 (diff) | |
download | Hyprland-53945cff3184cfdff3ed978e072b4ed65e3b2ec5.tar.gz Hyprland-53945cff3184cfdff3ed978e072b4ed65e3b2ec5.zip |
libinput: add tap_button_map (#1495)
-rw-r--r-- | src/config/ConfigManager.cpp | 2 | ||||
-rw-r--r-- | src/managers/input/InputManager.cpp | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 142c8d71..b8704467 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -154,6 +154,7 @@ void CConfigManager::setDefaultVars() { configValues["input:touchpad:natural_scroll"].intValue = 0; configValues["input:touchpad:disable_while_typing"].intValue = 1; configValues["input:touchpad:clickfinger_behavior"].intValue = 0; + configValues["input:touchpad:tap_button_map"].strValue = STRVAL_EMPTY; configValues["input:touchpad:middle_button_emulation"].intValue = 0; configValues["input:touchpad:tap-to-click"].intValue = 1; configValues["input:touchpad:tap-and-drag"].intValue = 1; @@ -199,6 +200,7 @@ void CConfigManager::setDeviceDefaultVars(const std::string& dev) { cfgValues["repeat_rate"].intValue = 25; cfgValues["repeat_delay"].intValue = 600; cfgValues["natural_scroll"].intValue = 0; + cfgValues["tap_button_map"].strValue = STRVAL_EMPTY; cfgValues["numlock_by_default"].intValue = 0; cfgValues["disable_while_typing"].intValue = 1; cfgValues["clickfinger_behavior"].intValue = 0; diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index b2e653ae..caaece20 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -761,6 +761,14 @@ void CInputManager::setPointerConfigs() { libinput_device_config_middle_emulation_set_enabled(LIBINPUTDEV, LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED); else libinput_device_config_middle_emulation_set_enabled(LIBINPUTDEV, LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED); + + const auto TAP_MAP = HASCONFIG ? g_pConfigManager->getDeviceString(devname, "tap_button_map") : g_pConfigManager->getString("input:touchpad:tap_button_map"); + if (TAP_MAP == "" || TAP_MAP == "lrm") + libinput_device_config_tap_set_button_map(LIBINPUTDEV, LIBINPUT_CONFIG_TAP_MAP_LRM); + else if (TAP_MAP == "lmr") + libinput_device_config_tap_set_button_map(LIBINPUTDEV, LIBINPUT_CONFIG_TAP_MAP_LMR); + else + Debug::log(WARN, "Tap button mapping unknown"); } const auto SCROLLMETHOD = HASCONFIG ? g_pConfigManager->getDeviceString(devname, "scroll_method") : g_pConfigManager->getString("input:scroll_method"); |