mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
Implement input configuration for trackballs (#743)
* niri-config: add trackball configuration struct The available options are mostly the same as for mice. I've verified that each option is applicable to trackballs in the libinput CLI. * input: apply trackball config settings
This commit is contained in:
@@ -70,6 +70,8 @@ pub struct Input {
|
||||
#[knuffel(child, default)]
|
||||
pub trackpoint: Trackpoint,
|
||||
#[knuffel(child, default)]
|
||||
pub trackball: Trackball,
|
||||
#[knuffel(child, default)]
|
||||
pub tablet: Tablet,
|
||||
#[knuffel(child, default)]
|
||||
pub touch: Touch,
|
||||
@@ -218,6 +220,22 @@ pub struct Trackpoint {
|
||||
pub middle_emulation: bool,
|
||||
}
|
||||
|
||||
#[derive(knuffel::Decode, Debug, Default, PartialEq)]
|
||||
pub struct Trackball {
|
||||
#[knuffel(child)]
|
||||
pub off: bool,
|
||||
#[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>,
|
||||
#[knuffel(child)]
|
||||
pub left_handed: bool,
|
||||
#[knuffel(child)]
|
||||
pub middle_emulation: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum ClickMethod {
|
||||
Clickfinger,
|
||||
@@ -2904,6 +2922,15 @@ mod tests {
|
||||
scroll-method "on-button-down"
|
||||
}
|
||||
|
||||
trackball {
|
||||
off
|
||||
natural-scroll
|
||||
accel-speed 0.0
|
||||
accel-profile "flat"
|
||||
left-handed
|
||||
middle-emulation
|
||||
}
|
||||
|
||||
tablet {
|
||||
map-to-output "eDP-1"
|
||||
}
|
||||
@@ -3091,6 +3118,14 @@ mod tests {
|
||||
scroll_method: Some(ScrollMethod::OnButtonDown),
|
||||
middle_emulation: false,
|
||||
},
|
||||
trackball: Trackball {
|
||||
off: true,
|
||||
natural_scroll: true,
|
||||
accel_speed: 0.0,
|
||||
accel_profile: Some(AccelProfile::Flat),
|
||||
left_handed: true,
|
||||
middle_emulation: true,
|
||||
},
|
||||
tablet: Tablet {
|
||||
off: false,
|
||||
map_to_output: Some("eDP-1".to_owned()),
|
||||
|
||||
Reference in New Issue
Block a user