mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-04-02 09:11:29 +03:00
fix remaining clippy lints
This commit is contained in:
@@ -140,7 +140,7 @@ impl EventConsumer for MacOSConsumer {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
// store button state
|
// store button state
|
||||||
self.button_state[mouse_button] = if state == 1 { true } else { false };
|
self.button_state[mouse_button] = state == 1;
|
||||||
|
|
||||||
let location = self.get_mouse_location().unwrap();
|
let location = self.get_mouse_location().unwrap();
|
||||||
let event = match CGEvent::new_mouse_event(
|
let event = match CGEvent::new_mouse_event(
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ fn send_mouse_input(mi: MOUSEINPUT) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
SendInput(
|
SendInput(
|
||||||
1 as u32,
|
1_u32,
|
||||||
&mut input as LPINPUT,
|
&mut input as LPINPUT,
|
||||||
std::mem::size_of::<INPUT>() as i32,
|
std::mem::size_of::<INPUT>() as i32,
|
||||||
);
|
);
|
||||||
@@ -173,7 +173,7 @@ fn send_keyboard_input(ki: KEYBDINPUT) {
|
|||||||
u: std::mem::zeroed(),
|
u: std::mem::zeroed(),
|
||||||
};
|
};
|
||||||
*input.u.ki_mut() = ki;
|
*input.u.ki_mut() = ki;
|
||||||
SendInput(1 as u32, &mut input, std::mem::size_of::<INPUT>() as i32);
|
SendInput(1_u32, &mut input, std::mem::size_of::<INPUT>() as i32);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
use anyhow::{anyhow, Result};
|
||||||
use crate::client::{ClientEvent, ClientHandle};
|
use crate::client::{ClientEvent, ClientHandle};
|
||||||
use crate::event::Event;
|
use crate::event::Event;
|
||||||
use crate::producer::EventProducer;
|
use crate::producer::EventProducer;
|
||||||
@@ -8,8 +9,8 @@ use std::{io, pin::Pin};
|
|||||||
pub struct MacOSProducer;
|
pub struct MacOSProducer;
|
||||||
|
|
||||||
impl MacOSProducer {
|
impl MacOSProducer {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Result<Self> {
|
||||||
Self {}
|
Err(anyhow!("not yet implemented"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,10 @@ use crate::{
|
|||||||
|
|
||||||
pub async fn create() -> Box<dyn EventProducer> {
|
pub async fn create() -> Box<dyn EventProducer> {
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
return Box::new(producer::macos::MacOSProducer::new());
|
match producer::macos::MacOSProducer::new() {
|
||||||
|
Ok(p) => return Box::new(p),
|
||||||
|
Err(e) => log::info!("macos event producer not available: {e}"),
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
match producer::windows::WindowsProducer::new() {
|
match producer::windows::WindowsProducer::new() {
|
||||||
|
|||||||
Reference in New Issue
Block a user