Skip to content

Commit 4c3c289

Browse files
committed
Implement scroll factor configuration for AxisSource::Continuous
1 parent c722634 commit 4c3c289

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

niri-config/src/input.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ pub struct Input {
2323
pub workspace_auto_back_and_forth: bool,
2424
pub mod_key: Option<ModKey>,
2525
pub mod_key_nested: Option<ModKey>,
26+
pub button_scroll_factor: Option<ScrollFactor>,
2627
}
2728

2829
#[derive(knuffel::Decode, Debug, Default, PartialEq)]
@@ -53,6 +54,8 @@ pub struct InputPart {
5354
pub mod_key: Option<ModKey>,
5455
#[knuffel(child, unwrap(argument, str))]
5556
pub mod_key_nested: Option<ModKey>,
57+
#[knuffel(child)]
58+
pub button_scroll_factor: Option<ScrollFactor>,
5659
}
5760

5861
impl MergeWith<InputPart> for Input {
@@ -80,6 +83,7 @@ impl MergeWith<InputPart> for Input {
8083
focus_follows_mouse,
8184
mod_key,
8285
mod_key_nested,
86+
button_scroll_factor,
8387
);
8488
}
8589
}

src/input/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3329,6 +3329,7 @@ impl State {
33293329
match source {
33303330
AxisSource::Wheel => config.input.mouse.scroll_factor,
33313331
AxisSource::Finger => config.input.touchpad.scroll_factor,
3332+
AxisSource::Continuous => config.input.button_scroll_factor,
33323333
_ => None,
33333334
}
33343335
};

0 commit comments

Comments
 (0)