input: Add a scroll_factor config option

This is not a setting handled by libinput; we have to scale the
scrolling ourselves.

This should match the behavior of the `scroll_factor` defined in
sway-input(5).
This commit is contained in:
Ian Douglas Scott 2023-09-01 12:33:55 -07:00
parent 511ee8d87a
commit 20159a6c8c
4 changed files with 39 additions and 6 deletions

View file

@ -64,6 +64,7 @@ pub fn for_device(device: &InputDevice) -> InputConfig {
} else {
None
},
scroll_factor: None,
})
} else {
None
@ -83,7 +84,7 @@ pub fn for_device(device: &InputDevice) -> InputConfig {
// Get setting from `device_config` if present, then `default_config`
// Returns `is_default` to indicate this is a default value.
fn get_config<'a, T: 'a, F: Fn(&'a InputConfig) -> Option<T>>(
pub fn get_config<'a, T: 'a, F: Fn(&'a InputConfig) -> Option<T>>(
device_config: Option<&'a InputConfig>,
default_config: &'a InputConfig,
f: F,