diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-06-11 18:26:24 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-11 18:26:24 +0200 |
| commit | 48ab282a699d7b7858b002c4a66d939a7b16f8c5 (patch) | |
| tree | 29f92c58fbcba3a88cc3248b7560a1544c403e0d /src/managers/input/InputManager.cpp | |
| parent | 94528bcdbc72a8a3a18dc309bfe678915f9a27d5 (diff) | |
| parent | 018b0684ddebcd5bce53886dc2558f616e722f2f (diff) | |
Merge pull request #195 from PowerBall253/main
Add natural_scrolling option for touchpads only
Diffstat (limited to 'src/managers/input/InputManager.cpp')
| -rw-r--r-- | src/managers/input/InputManager.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 157ee9bb..4a35a8c7 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -326,8 +326,14 @@ void CInputManager::newMouse(wlr_input_device* mouse) { if (libinput_device_config_tap_get_finger_count(LIBINPUTDEV)) // this is for tapping (like on a laptop) libinput_device_config_tap_set_enabled(LIBINPUTDEV, LIBINPUT_CONFIG_TAP_ENABLED); - if (libinput_device_config_scroll_has_natural_scroll(LIBINPUTDEV)) - libinput_device_config_scroll_set_natural_scroll_enabled(LIBINPUTDEV, g_pConfigManager->getInt("input:natural_scroll")); + if (libinput_device_config_scroll_has_natural_scroll(LIBINPUTDEV)) { + double w = 0, h = 0; + + if (libinput_device_has_capability(LIBINPUTDEV, LIBINPUT_DEVICE_CAP_POINTER) && libinput_device_get_size(LIBINPUTDEV, &w, &h) == 0) // pointer with size is a touchpad + libinput_device_config_scroll_set_natural_scroll_enabled(LIBINPUTDEV, g_pConfigManager->getInt("input:touchpad:natural_scroll")); + else + libinput_device_config_scroll_set_natural_scroll_enabled(LIBINPUTDEV, g_pConfigManager->getInt("input:natural_scroll")); + } if (libinput_device_config_dwt_is_available(LIBINPUTDEV)) { const auto DWT = static_cast<enum libinput_config_dwt_state>(g_pConfigManager->getInt("input:touchpad:disable_while_typing") != 0); |
