diff options
| -rw-r--r-- | niri-config/src/lib.rs | 3 | ||||
| -rw-r--r-- | src/input/mod.rs | 10 |
2 files changed, 13 insertions, 0 deletions
diff --git a/niri-config/src/lib.rs b/niri-config/src/lib.rs index ca7d3807..51693a94 100644 --- a/niri-config/src/lib.rs +++ b/niri-config/src/lib.rs @@ -349,6 +349,8 @@ pub struct Tablet { #[derive(knuffel::Decode, Debug, Default, PartialEq)] pub struct Touch { + #[knuffel(child)] + pub off: bool, #[knuffel(child, unwrap(argument))] pub map_to_output: Option<String>, } @@ -3900,6 +3902,7 @@ mod tests { left_handed: false, }, touch: Touch { + off: false, map_to_output: Some( "eDP-1", ), diff --git a/src/input/mod.rs b/src/input/mod.rs index 8f923473..51555a96 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -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 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( |
