diff --git a/src/keyboard.rs b/src/keyboard.rs index b82290605..40de9b5df 100644 --- a/src/keyboard.rs +++ b/src/keyboard.rs @@ -10,7 +10,9 @@ use crate::ui::CUR_SESSION; #[cfg(not(any(target_os = "android", target_os = "ios")))] use hbb_common::log; use hbb_common::message_proto::*; -use rdev::{Event, EventType, Key, KeyCode}; +#[cfg(any(target_os = "windows", target_os = "macos"))] +use rdev::KeyCode; +use rdev::{Event, EventType, Key}; #[cfg(any(target_os = "windows", target_os = "macos"))] use std::sync::atomic::{AtomicBool, Ordering}; use std::{ @@ -892,15 +894,6 @@ fn is_press(event: &Event) -> bool { matches!(event.event_type, EventType::KeyPress(_)) } -fn is_numpad_key(event: &Event) -> bool { - matches!(event.event_type, EventType::KeyPress(key) | EventType::KeyRelease(key) if match key { - Key::Kp0 | Key::Kp1 | Key::Kp2 | Key::Kp3| Key::Kp4| Key::Kp5| Key::Kp6| - Key::Kp7| Key::Kp8| Key::Kp9 | Key::KpMinus | Key::KpMultiply | - Key::KpDivide | Key::KpPlus | Key::KpDecimal => true, - _ => false - }) -} - pub fn translate_keyboard_mode(peer: &str, event: &Event, key_event: KeyEvent) -> Vec { let mut events: Vec = Vec::new(); if let Some(unicode_info) = &event.unicode {