From c61952d2ee74c4874ee0dd5df14a41a3fc59adb4 Mon Sep 17 00:00:00 2001 From: PeterOGB Date: Wed, 18 Oct 2023 17:02:40 +0100 Subject: [PATCH 1/3] Get mouse scroll values and apply them. --- src/core/seat/pointing-device.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/core/seat/pointing-device.cpp b/src/core/seat/pointing-device.cpp index 6b2dc3257..b8bef9d76 100644 --- a/src/core/seat/pointing-device.cpp +++ b/src/core/seat/pointing-device.cpp @@ -14,6 +14,8 @@ void wf::pointing_device_t::config_t::load() mouse_scroll_speed.load_option("input/mouse_scroll_speed"); mouse_cursor_speed.load_option("input/mouse_cursor_speed"); + mouse_scroll_button.load_option("input/mouse_scroll_button"); + mouse_scroll_method.load_option("input/mouse_scroll_method"); touchpad_cursor_speed.load_option("input/touchpad_cursor_speed"); touchpad_scroll_speed.load_option("input/touchpad_scroll_speed"); @@ -64,6 +66,23 @@ void wf::pointing_device_t::update_options() libinput_device_config_left_handed_set(dev, config.left_handed_mode); + if ((std::string)config.mouse_scroll_method == "default") + { + libinput_device_config_scroll_set_method(dev, + libinput_device_config_scroll_get_default_method(dev)); + } else if ((std::string)config.mouse_scroll_method == "none") + { + libinput_device_config_scroll_set_method(dev, + LIBINPUT_CONFIG_SCROLL_NO_SCROLL); + } else if ( ((std::string)config.mouse_scroll_method == "on-button-down") && + ((int)config.mouse_scroll_button != 0)) + { + libinput_device_config_scroll_set_method(dev, + LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN); + libinput_device_config_scroll_set_button(dev, + (int)config.mouse_scroll_button); + } + libinput_device_config_middle_emulation_set_enabled(dev, config.middle_emulation ? LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED : From 3be1c0b4462ff0c7f99cad20b5173104b08a39c1 Mon Sep 17 00:00:00 2001 From: PeterOGB Date: Wed, 18 Oct 2023 17:05:21 +0100 Subject: [PATCH 2/3] Add new config items for mouse scroll --- src/core/seat/pointing-device.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/seat/pointing-device.hpp b/src/core/seat/pointing-device.hpp index e95c22e36..8bafad73b 100644 --- a/src/core/seat/pointing-device.hpp +++ b/src/core/seat/pointing-device.hpp @@ -18,6 +18,8 @@ struct pointing_device_t : public input_device_impl_t wf::option_wrapper_t middle_emulation; wf::option_wrapper_t mouse_cursor_speed; wf::option_wrapper_t mouse_scroll_speed; + wf::option_wrapper_t mouse_scroll_button; + wf::option_wrapper_t mouse_scroll_method; wf::option_wrapper_t tablet_motion_mode; wf::option_wrapper_t touchpad_cursor_speed; wf::option_wrapper_t touchpad_scroll_speed; From ed9980eefd093ee428fe5ddbabef17d2be4f5ec4 Mon Sep 17 00:00:00 2001 From: PeterOGB Date: Wed, 18 Oct 2023 17:13:28 +0100 Subject: [PATCH 3/3] Add definitions for mouse scroll method and button --- metadata/input.xml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/metadata/input.xml b/metadata/input.xml index 5d637725f..684afe2e6 100644 --- a/metadata/input.xml +++ b/metadata/input.xml @@ -111,6 +111,29 @@ 1.0 0.0 + +