forge
Explore
Log in

Don't you dare go Hollow

Add off option to touch device

Browse files at this commit

1bdded7a44ae002243cfae5a055607fa14820d73nnyyxxxxParent: 9bfe90d
  • feat
    • add off option to touch device
Show full message
feat(input): add off option to touch device
niri-config/src/lib.rsmodified+3 -0
@@ -349,6 +349,8 @@ pub struct Tablet {
349349
350350 #[derive(knuffel::Decode, Debug, Default, PartialEq)]
351351 pub struct Touch {
352+ #[knuffel(child)]
353+ pub off: bool,
352354 #[knuffel(child, unwrap(argument))]
353355 pub map_to_output: Option<String>,
354356 }
@@ -3900,6 +3902,7 @@ mod tests {
39003902 left_handed: false,
39013903 },
39023904 touch: Touch {
3905+ off: false,
39033906 map_to_output: Some(
39043907 "eDP-1",
39053908 ),
src/input/mod.rsmodified+10 -0
@@ -3512,6 +3512,16 @@ pub fn apply_libinput_settings(config: &niri_config::Input, device: &mut input::
35123512
35133513 let _ = device.config_left_handed_set(c.left_handed);
35143514 }
3515+
3516+ let is_touch = device.has_capability(input::DeviceCapability::Touch);
3517+ if is_touch {
3518+ let c = &config.touch;
3519+ let _ = device.config_send_events_set_mode(if c.off {
3520+ input::SendEventsMode::DISABLED
3521+ } else {
3522+ input::SendEventsMode::ENABLED
3523+ });
3524+ }
35153525 }
35163526
35173527 pub fn mods_with_binds(