mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
input: enable configuring of trackpoint devices
This commit is contained in:
committed by
Ivan Molodetskikh
parent
8e1d4de0dc
commit
363e1d8764
@@ -57,6 +57,8 @@ pub struct Input {
|
||||
#[knuffel(child, default)]
|
||||
pub mouse: Mouse,
|
||||
#[knuffel(child, default)]
|
||||
pub trackpoint: Trackpoint,
|
||||
#[knuffel(child, default)]
|
||||
pub tablet: Tablet,
|
||||
#[knuffel(child)]
|
||||
pub disable_power_key_handling: bool,
|
||||
@@ -151,6 +153,16 @@ pub struct Mouse {
|
||||
pub accel_profile: Option<AccelProfile>,
|
||||
}
|
||||
|
||||
#[derive(knuffel::Decode, Debug, Default, PartialEq)]
|
||||
pub struct Trackpoint {
|
||||
#[knuffel(child)]
|
||||
pub natural_scroll: bool,
|
||||
#[knuffel(child, unwrap(argument), default)]
|
||||
pub accel_speed: f64,
|
||||
#[knuffel(child, unwrap(argument, str))]
|
||||
pub accel_profile: Option<AccelProfile>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum AccelProfile {
|
||||
Adaptive,
|
||||
@@ -924,6 +936,12 @@ mod tests {
|
||||
accel-profile "flat"
|
||||
}
|
||||
|
||||
trackpoint {
|
||||
natural-scroll
|
||||
accel-speed 0.0
|
||||
accel-profile "flat"
|
||||
}
|
||||
|
||||
tablet {
|
||||
map-to-output "eDP-1"
|
||||
}
|
||||
@@ -1043,6 +1061,11 @@ mod tests {
|
||||
accel_speed: 0.4,
|
||||
accel_profile: Some(AccelProfile::Flat),
|
||||
},
|
||||
trackpoint: Trackpoint {
|
||||
natural_scroll: true,
|
||||
accel_speed: 0.0,
|
||||
accel_profile: Some(AccelProfile::Flat),
|
||||
},
|
||||
tablet: Tablet {
|
||||
map_to_output: Some("eDP-1".to_owned()),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user