mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-14 08:40:55 +03:00
defer creation of input capture / emulation (#117)
This commit is contained in:
committed by
GitHub
parent
636c5924bf
commit
77aa96e09a
@@ -8,7 +8,7 @@ use tokio::{
|
||||
|
||||
use crate::{
|
||||
client::{ClientEvent, ClientHandle},
|
||||
emulate::InputEmulation,
|
||||
emulate::{self, InputEmulation},
|
||||
event::{Event, KeyboardEvent},
|
||||
scancode,
|
||||
server::State,
|
||||
@@ -27,7 +27,6 @@ pub enum EmulationEvent {
|
||||
}
|
||||
|
||||
pub fn new(
|
||||
mut emulate: Box<dyn InputEmulation>,
|
||||
server: Server,
|
||||
mut udp_rx: Receiver<Result<(Event, SocketAddr)>>,
|
||||
sender_tx: Sender<(Event, SocketAddr)>,
|
||||
@@ -36,6 +35,7 @@ pub fn new(
|
||||
) -> (JoinHandle<Result<()>>, Sender<EmulationEvent>) {
|
||||
let (tx, mut rx) = tokio::sync::mpsc::channel(32);
|
||||
let emulate_task = tokio::task::spawn_local(async move {
|
||||
let mut emulate = emulate::create().await;
|
||||
let mut last_ignored = None;
|
||||
|
||||
loop {
|
||||
|
||||
Reference in New Issue
Block a user