mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
Merge branch 'flutter_desktop'
This commit is contained in:
@@ -1681,7 +1681,7 @@ pub enum Data {
|
||||
}
|
||||
|
||||
/// Keycode for key events.
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum Key {
|
||||
ControlKey(ControlKey),
|
||||
Chr(u32),
|
||||
|
||||
@@ -373,6 +373,16 @@ impl Session {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn input_raw_key(&self, keycode: i32, scancode: i32, down: bool){
|
||||
use rdev::{EventType::*, Key as RdevKey, *};
|
||||
if scancode < 0 || keycode < 0{
|
||||
return;
|
||||
}
|
||||
let key = rdev::key_from_scancode(scancode.try_into().unwrap()) as RdevKey;
|
||||
|
||||
log::info!("{:?}", key);
|
||||
}
|
||||
|
||||
/// Input a string of text.
|
||||
/// String is parsed into individual key presses.
|
||||
///
|
||||
@@ -471,7 +481,7 @@ impl Session {
|
||||
}
|
||||
let mut msg_out = Message::new();
|
||||
msg_out.set_key_event(key_event);
|
||||
log::debug!("{:?}", msg_out);
|
||||
// log::debug!("{:?}", msg_out);
|
||||
self.send_msg(msg_out);
|
||||
}
|
||||
|
||||
|
||||
@@ -208,6 +208,12 @@ pub fn session_switch_display(id: String, value: i32) {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn session_input_raw_key(id: String, keycode: i32, scancode:i32, down: bool){
|
||||
if let Some(session) = SESSIONS.read().unwrap().get(&id) {
|
||||
session.input_raw_key(keycode, scancode, down);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn session_input_key(
|
||||
id: String,
|
||||
name: String,
|
||||
|
||||
Reference in New Issue
Block a user