mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-11 23:30:55 +03:00
extract frontend crate (#186)
This commit is contained in:
committed by
GitHub
parent
12bc0d86ca
commit
be677d4c81
@@ -9,7 +9,8 @@ use input_capture::{
|
||||
self, CaptureError, CaptureEvent, CaptureHandle, InputCapture, InputCaptureError, Position,
|
||||
};
|
||||
|
||||
use crate::{client::ClientHandle, frontend::Status, server::State};
|
||||
use crate::server::State;
|
||||
use lan_mouse_ipc::{ClientHandle, Status};
|
||||
|
||||
use super::Server;
|
||||
|
||||
@@ -85,7 +86,7 @@ async fn do_capture(
|
||||
)
|
||||
});
|
||||
for (handle, pos) in clients {
|
||||
capture.create(handle, pos.into()).await?;
|
||||
capture.create(handle, to_capture_pos(pos)).await?;
|
||||
}
|
||||
|
||||
loop {
|
||||
@@ -194,3 +195,12 @@ fn spawn_hook_command(server: &Server, handle: ClientHandle) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
fn to_capture_pos(pos: lan_mouse_ipc::Position) -> input_capture::Position {
|
||||
match pos {
|
||||
lan_mouse_ipc::Position::Left => input_capture::Position::Left,
|
||||
lan_mouse_ipc::Position::Right => input_capture::Position::Right,
|
||||
lan_mouse_ipc::Position::Top => input_capture::Position::Top,
|
||||
lan_mouse_ipc::Position::Bottom => input_capture::Position::Bottom,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,12 +4,11 @@ use std::net::SocketAddr;
|
||||
use lan_mouse_proto::ProtoEvent;
|
||||
use tokio::task::JoinHandle;
|
||||
|
||||
use crate::{
|
||||
client::{ClientHandle, ClientManager},
|
||||
frontend::Status,
|
||||
server::State,
|
||||
};
|
||||
use lan_mouse_ipc::ClientHandle;
|
||||
|
||||
use crate::{client::ClientManager, server::State};
|
||||
use input_emulation::{self, EmulationError, EmulationHandle, InputEmulation, InputEmulationError};
|
||||
use lan_mouse_ipc::Status;
|
||||
|
||||
use super::{network_task::NetworkError, Server};
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ use lan_mouse_proto::ProtoEvent;
|
||||
use local_channel::mpsc::Sender;
|
||||
use tokio::task::JoinHandle;
|
||||
|
||||
use crate::client::ClientHandle;
|
||||
use lan_mouse_ipc::ClientHandle;
|
||||
|
||||
use super::{capture_task::CaptureRequest, emulation_task::EmulationRequest, Server, State};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user