mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-14 08:40:55 +03:00
fix windows build
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
use std::sync::mpsc::Receiver;
|
||||
|
||||
use winapi::{self, um::winuser::{INPUT, LPINPUT, INPUT_MOUSE, MOUSEINPUT, MOUSEEVENTF_MOVE}};
|
||||
use crate::event::{PointerEvent, KeyboardEvent};
|
||||
|
||||
use crate::{event::Event, client::{Client, ClientHandle}};
|
||||
|
||||
@@ -31,16 +32,21 @@ pub fn run(event_rx: Receiver<(Event, ClientHandle)>, _clients: Vec<Client>) {
|
||||
match event_rx.recv().expect("event receiver unavailable").0 {
|
||||
Event::Pointer(pointer_event) => {
|
||||
match pointer_event {
|
||||
crate::event::PointerEvent::Motion { time: _, relative_x, relative_y } => {
|
||||
PointerEvent::Motion { time: _, relative_x, relative_y } => {
|
||||
rel_mouse(relative_x as i32, relative_y as i32);
|
||||
},
|
||||
crate::event::PointerEvent::Button { .. } => {},
|
||||
crate::event::PointerEvent::Axis { .. } => {},
|
||||
crate::event::PointerEvent::Frame { } => {},
|
||||
PointerEvent::Button { .. } => {},
|
||||
PointerEvent::Axis { .. } => {},
|
||||
PointerEvent::Frame { } => {},
|
||||
}
|
||||
},
|
||||
Event::Keyboard(_) => {},
|
||||
Event::Release() => {},
|
||||
Event::Keyboard(keyboard_event) => {
|
||||
match keyboard_event {
|
||||
KeyboardEvent::Key {..} => {},
|
||||
KeyboardEvent::Modifiers {..} => {},
|
||||
}
|
||||
},
|
||||
Event::Release() => { },
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
15
src/main.rs
15
src/main.rs
@@ -1,16 +1,18 @@
|
||||
use std::{net::SocketAddr, sync::mpsc, thread, env};
|
||||
use std::{net::SocketAddr, sync::mpsc, thread};
|
||||
|
||||
#[cfg(unix)]
|
||||
use std::env;
|
||||
|
||||
use lan_mouse::{
|
||||
client::{ClientManager, Position},
|
||||
config, dns, event, request, backend::Backend,
|
||||
config, dns, event, request,
|
||||
};
|
||||
|
||||
#[cfg(windows)]
|
||||
use lan_mouse::backend::windows;
|
||||
|
||||
#[cfg(unix)]
|
||||
use lan_mouse::backend::wayland;
|
||||
use lan_mouse::backend::x11;
|
||||
use lan_mouse::backend::{Backend,wayland,x11};
|
||||
|
||||
fn add_client(client_manager: &mut ClientManager, client: &config::Client, pos: Position) {
|
||||
let ip = match client.ip {
|
||||
@@ -75,6 +77,11 @@ pub fn main() {
|
||||
}
|
||||
Err(_) => panic!("could not detect session type"),
|
||||
};
|
||||
|
||||
#[cfg(windows)]
|
||||
println!("using backend: windows");
|
||||
|
||||
#[cfg(unix)]
|
||||
println!("using backend: {}", match backend {
|
||||
Backend::X11 => "x11",
|
||||
Backend::WAYLAND => "wayland",
|
||||
|
||||
Reference in New Issue
Block a user