diff options
| author | Yuya Nishihara <yuya@tcha.org> | 2024-05-26 14:41:00 +0900 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-05-26 16:49:40 +0300 |
| commit | 4746a0da7dffde6befcb3c80609fa3d31bffc29c (patch) | |
| tree | 5267194f8152d5138ab88020b0d3d1224bb863ed /src/input | |
| parent | 2ac8d840343dc964981507353c9128c68361cb6f (diff) | |
| download | niri-4746a0da7dffde6befcb3c80609fa3d31bffc29c.tar.gz niri-4746a0da7dffde6befcb3c80609fa3d31bffc29c.tar.bz2 niri-4746a0da7dffde6befcb3c80609fa3d31bffc29c.zip | |
Add scroll-method property to pointer devices
My use case is to enable middle-button scroll on my keyboard with pointing
stick. The device is recognized as USB mouse.
Diffstat (limited to 'src/input')
| -rw-r--r-- | src/input/mod.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/input/mod.rs b/src/input/mod.rs index 8bf94d15..a36ea62b 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -2232,6 +2232,12 @@ pub fn apply_libinput_settings(config: &niri_config::Input, device: &mut input:: let _ = device.config_accel_set_profile(default); } + if let Some(method) = c.scroll_method { + let _ = device.config_scroll_set_method(method.into()); + } else if let Some(default) = device.config_scroll_default_method() { + let _ = device.config_scroll_set_method(default); + } + if let Some(tap_button_map) = c.tap_button_map { let _ = device.config_tap_set_button_map(tap_button_map.into()); } else if let Some(default) = device.config_tap_default_button_map() { @@ -2275,6 +2281,12 @@ pub fn apply_libinput_settings(config: &niri_config::Input, device: &mut input:: } else if let Some(default) = device.config_accel_default_profile() { let _ = device.config_accel_set_profile(default); } + + if let Some(method) = c.scroll_method { + let _ = device.config_scroll_set_method(method.into()); + } else if let Some(default) = device.config_scroll_default_method() { + let _ = device.config_scroll_set_method(default); + } } if is_trackpoint { @@ -2287,6 +2299,12 @@ pub fn apply_libinput_settings(config: &niri_config::Input, device: &mut input:: } else if let Some(default) = device.config_accel_default_profile() { let _ = device.config_accel_set_profile(default); } + + if let Some(method) = c.scroll_method { + let _ = device.config_scroll_set_method(method.into()); + } else if let Some(default) = device.config_scroll_default_method() { + let _ = device.config_scroll_set_method(default); + } } let is_tablet = device.has_capability(input::DeviceCapability::TabletTool); |
