Allow input capture & emulation being disabled (#158)

* Input capture and emulation can now be disabled and will prompt the user to enable again.

* Improved error handling to deliver more useful error messages
This commit is contained in:
Ferdinand Schober
2024-07-16 20:34:46 +02:00
committed by GitHub
parent 55bdf1e63e
commit bea7d6f8a5
41 changed files with 2079 additions and 1543 deletions

View File

@@ -37,7 +37,7 @@ pub fn run() -> Result<()> {
emulation_test::run()?;
} else if config.daemon {
// if daemon is specified we run the service
run_service(&config)?;
run_service(config)?;
} else {
// otherwise start the service as a child process and
// run a frontend
@@ -58,7 +58,7 @@ pub fn run() -> Result<()> {
anyhow::Ok(())
}
fn run_service(config: &Config) -> Result<()> {
fn run_service(config: Config) -> Result<()> {
// create single threaded tokio runtime
let runtime = tokio::runtime::Builder::new_current_thread()
.enable_io()
@@ -70,10 +70,8 @@ fn run_service(config: &Config) -> Result<()> {
// run main loop
log::info!("Press {:?} to release the mouse", config.release_bind);
let server = Server::new(config);
server
.run(config.capture_backend, config.emulation_backend)
.await?;
let mut server = Server::new(config);
server.run().await?;
log::debug!("service exiting");
anyhow::Ok(())