feat: simplify and change configuration (#279)

*breaking change*
this changes the configuration syntax, allowing for an unlimited amount of configured clients.
Also a first step towards enabling a "save config" feature.
This commit is contained in:
Ferdinand Schober
2025-03-15 18:45:19 +01:00
committed by GitHub
parent 2f6a3629ad
commit 92f652df2e
10 changed files with 226 additions and 245 deletions

View File

@@ -4,13 +4,13 @@ use futures::StreamExt;
use input_capture::{self, CaptureError, CaptureEvent, InputCapture, InputCaptureError, Position};
use input_event::{Event, KeyboardEvent};
#[derive(Args, Debug, Eq, PartialEq)]
#[derive(Args, Clone, Debug, Eq, PartialEq)]
pub struct TestCaptureArgs {}
pub async fn run(config: Config, _args: TestCaptureArgs) -> Result<(), InputCaptureError> {
log::info!("running input capture test");
log::info!("creating input capture");
let backend = config.capture_backend.map(|b| b.into());
let backend = config.capture_backend().map(|b| b.into());
loop {
let mut input_capture = InputCapture::new(backend).await?;
log::info!("creating clients");