mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-15 09:10:53 +03:00
defer creation of input capture / emulation (#117)
This commit is contained in:
committed by
GitHub
parent
636c5924bf
commit
77aa96e09a
@@ -5,7 +5,7 @@ use std::{collections::HashSet, net::SocketAddr};
|
||||
use tokio::{sync::mpsc::Sender, task::JoinHandle};
|
||||
|
||||
use crate::{
|
||||
capture::InputCapture,
|
||||
capture::{self, InputCapture},
|
||||
client::{ClientEvent, ClientHandle},
|
||||
event::{Event, KeyboardEvent},
|
||||
scancode,
|
||||
@@ -25,7 +25,6 @@ pub enum CaptureEvent {
|
||||
}
|
||||
|
||||
pub fn new(
|
||||
mut capture: Box<dyn InputCapture>,
|
||||
server: Server,
|
||||
sender_tx: Sender<(Event, SocketAddr)>,
|
||||
timer_tx: Sender<()>,
|
||||
@@ -33,6 +32,7 @@ pub fn new(
|
||||
) -> (JoinHandle<Result<()>>, Sender<CaptureEvent>) {
|
||||
let (tx, mut rx) = tokio::sync::mpsc::channel(32);
|
||||
let task = tokio::task::spawn_local(async move {
|
||||
let mut capture = capture::create().await;
|
||||
let mut pressed_keys = HashSet::new();
|
||||
loop {
|
||||
tokio::select! {
|
||||
|
||||
Reference in New Issue
Block a user