mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-23 05:00:52 +03:00
cleanup main (#189)
This commit is contained in:
committed by
GitHub
parent
be677d4c81
commit
6cd190191e
@@ -2,22 +2,9 @@ use crate::config::Config;
|
||||
use futures::StreamExt;
|
||||
use input_capture::{self, CaptureError, CaptureEvent, InputCapture, InputCaptureError, Position};
|
||||
use input_event::{Event, KeyboardEvent};
|
||||
use tokio::task::LocalSet;
|
||||
|
||||
pub fn run() -> Result<(), InputCaptureError> {
|
||||
pub async fn run(config: Config) -> Result<(), InputCaptureError> {
|
||||
log::info!("running input capture test");
|
||||
let runtime = tokio::runtime::Builder::new_current_thread()
|
||||
.enable_io()
|
||||
.enable_time()
|
||||
.build()
|
||||
.unwrap();
|
||||
|
||||
let config = Config::new().unwrap();
|
||||
|
||||
runtime.block_on(LocalSet::new().run_until(input_capture_test(config)))
|
||||
}
|
||||
|
||||
async fn input_capture_test(config: Config) -> Result<(), InputCaptureError> {
|
||||
log::info!("creating input capture");
|
||||
let backend = config.capture_backend.map(|b| b.into());
|
||||
loop {
|
||||
|
||||
Reference in New Issue
Block a user