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 + + 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 : 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;