From a7056394f54762872d58b0d946edb6e33421667f Mon Sep 17 00:00:00 2001 From: Frederick Zhang Date: Thu, 11 Aug 2022 00:45:14 +1000 Subject: [PATCH] Avoid monitoring xremap virtual device When a device is removed, xremap re-selects devices. Now since xremap is already running and the virtual device already exists, we need to filter it out from the new device list. --- src/device.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/device.rs b/src/device.rs index 8175e47..b2c5ad6 100644 --- a/src/device.rs +++ b/src/device.rs @@ -194,6 +194,9 @@ impl InputDevice { impl InputDevice { pub fn is_input_device(&self, device_filter: &[String], ignore_filter: &[String], mouse: bool) -> bool { + if self.device_name() == Self::current_name() { + return false; + } (if device_filter.is_empty() { self.is_keyboard() || (mouse && self.is_mouse()) } else {