mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-01-18 07:43:01 +08:00
Refactor to remove warning
This commit is contained in:
parent
72273f4546
commit
80b01a96db
@ -3,7 +3,7 @@ use super::*;
|
||||
use dispatch::Queue;
|
||||
use enigo::{Enigo, Key, KeyboardControllable, MouseButton, MouseControllable};
|
||||
use hbb_common::{config::COMPRESS_LEVEL, protobuf::ProtobufEnumOrUnknown};
|
||||
use rdev::{simulate, EventType, EventType::*, Key as RdevKey, SimulateError};
|
||||
use rdev::{simulate, EventType, Key as RdevKey};
|
||||
use std::{
|
||||
convert::TryFrom,
|
||||
sync::atomic::{AtomicBool, Ordering},
|
||||
|
@ -283,8 +283,6 @@ impl Handler {
|
||||
}
|
||||
log::info!("keyboard hooked");
|
||||
let mut me = self.clone();
|
||||
let peer = self.peer_platform();
|
||||
let is_win = peer == "Windows";
|
||||
#[cfg(windows)]
|
||||
crate::platform::windows::enable_lowlevel_keyboard(std::ptr::null_mut() as _);
|
||||
std::thread::spawn(move || {
|
||||
@ -308,7 +306,7 @@ impl Handler {
|
||||
{
|
||||
return;
|
||||
}
|
||||
let (key, down) = match evt.event_type {
|
||||
let (_key, down) = match evt.event_type {
|
||||
KeyPress(k) => {
|
||||
// keyboard long press
|
||||
if MUTEX_SPECIAL_KEYS.lock().unwrap().contains_key(&k) {
|
||||
@ -330,9 +328,9 @@ impl Handler {
|
||||
};
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
let key = rdev::get_win_key(evt.code.into(), evt.scan_code);
|
||||
let _key = rdev::get_win_key(evt.code.into(), evt.scan_code);
|
||||
|
||||
me.key_down_or_up(down, key, evt);
|
||||
me.key_down_or_up(down, _key, evt);
|
||||
};
|
||||
if let Err(error) = rdev::listen(func) {
|
||||
log::error!("rdev: {:?}", error);
|
||||
|
Loading…
Reference in New Issue
Block a user