mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
feat(input): add off option to touch device
This commit is contained in:
committed by
Ivan Molodetskikh
parent
9bfe90dee1
commit
1bdded7a44
@@ -349,6 +349,8 @@ pub struct Tablet {
|
|||||||
|
|
||||||
#[derive(knuffel::Decode, Debug, Default, PartialEq)]
|
#[derive(knuffel::Decode, Debug, Default, PartialEq)]
|
||||||
pub struct Touch {
|
pub struct Touch {
|
||||||
|
#[knuffel(child)]
|
||||||
|
pub off: bool,
|
||||||
#[knuffel(child, unwrap(argument))]
|
#[knuffel(child, unwrap(argument))]
|
||||||
pub map_to_output: Option<String>,
|
pub map_to_output: Option<String>,
|
||||||
}
|
}
|
||||||
@@ -3900,6 +3902,7 @@ mod tests {
|
|||||||
left_handed: false,
|
left_handed: false,
|
||||||
},
|
},
|
||||||
touch: Touch {
|
touch: Touch {
|
||||||
|
off: false,
|
||||||
map_to_output: Some(
|
map_to_output: Some(
|
||||||
"eDP-1",
|
"eDP-1",
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -3512,6 +3512,16 @@ pub fn apply_libinput_settings(config: &niri_config::Input, device: &mut input::
|
|||||||
|
|
||||||
let _ = device.config_left_handed_set(c.left_handed);
|
let _ = device.config_left_handed_set(c.left_handed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let is_touch = device.has_capability(input::DeviceCapability::Touch);
|
||||||
|
if is_touch {
|
||||||
|
let c = &config.touch;
|
||||||
|
let _ = device.config_send_events_set_mode(if c.off {
|
||||||
|
input::SendEventsMode::DISABLED
|
||||||
|
} else {
|
||||||
|
input::SendEventsMode::ENABLED
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn mods_with_binds(
|
pub fn mods_with_binds(
|
||||||
|
|||||||
Reference in New Issue
Block a user