From 77125b7a98a722f7015148cee4771e3d716940c1 Mon Sep 17 00:00:00 2001 From: asur4s Date: Sun, 26 Mar 2023 06:08:58 -0700 Subject: [PATCH] fix conflict --- src/keyboard.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) 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 {