From 5ad5116de42ddfd585d2027523e967b2f5e2eced Mon Sep 17 00:00:00 2001 From: rszyma Date: Tue, 12 Dec 2023 02:04:27 +0100 Subject: [PATCH] fix(linux): libinput "disable while typing" while kanata is running (#661) Change virtual output device's bus_type from BUS_USB to BUS_I8042. This fixes the dwt issues for me on Hyprland and I haven't noticed any regression caused by this change. Tested manually in Hyprland with `disable_while_typing=1` Closes #548 Closes #659 --- src/oskbd/linux.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/oskbd/linux.rs b/src/oskbd/linux.rs index d6e8319ae..0faa304d0 100644 --- a/src/oskbd/linux.rs +++ b/src/oskbd/linux.rs @@ -347,7 +347,9 @@ impl KbdOut { let mut device = uinput::VirtualDeviceBuilder::new()? .name("kanata") - .input_id(evdev::InputId::new(evdev::BusType::BUS_USB, 1, 1, 1)) + // libinput's "disable while typing" feature don't work when bus_type + // is set to BUS_USB, but appears to work when it's set to BUS_I8042. + .input_id(evdev::InputId::new(evdev::BusType::BUS_I8042, 1, 1, 1)) .with_keys(&keys)? .with_relative_axes(&relative_axes)? .build()?;