mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
refactor: keyboard of client
This commit is contained in:
@@ -49,10 +49,7 @@ pub use super::lang::*;
|
||||
pub mod file_trait;
|
||||
pub mod helper;
|
||||
pub mod io_loop;
|
||||
use crate::{
|
||||
server::video_service::{SCRAP_X11_REF_URL, SCRAP_X11_REQUIRED},
|
||||
ui_session_interface::global_save_keyboard_mode,
|
||||
};
|
||||
use crate::server::video_service::{SCRAP_X11_REF_URL, SCRAP_X11_REQUIRED};
|
||||
pub static SERVER_KEYBOARD_ENABLED: AtomicBool = AtomicBool::new(true);
|
||||
pub static SERVER_FILE_TRANSFER_ENABLED: AtomicBool = AtomicBool::new(true);
|
||||
pub static SERVER_CLIPBOARD_ENABLED: AtomicBool = AtomicBool::new(true);
|
||||
@@ -989,6 +986,17 @@ impl LoginConfigHandler {
|
||||
self.save_config(config);
|
||||
}
|
||||
|
||||
/// Save keyboard mode to the current config.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `value` - The view style to be saved.
|
||||
pub fn save_keyboard_mode(&mut self, value: String) {
|
||||
let mut config = self.load_config();
|
||||
config.keyboard_mode = value;
|
||||
self.save_config(config);
|
||||
}
|
||||
|
||||
/// Save scroll style to the current config.
|
||||
///
|
||||
/// # Arguments
|
||||
@@ -1382,9 +1390,6 @@ impl LoginConfigHandler {
|
||||
if !pi.version.is_empty() {
|
||||
self.version = hbb_common::get_version_number(&pi.version);
|
||||
}
|
||||
if hbb_common::get_version_number(&pi.version) < hbb_common::get_version_number("1.2.0") {
|
||||
global_save_keyboard_mode("legacy".to_owned());
|
||||
}
|
||||
self.features = pi.features.clone().into_option();
|
||||
let serde = PeerInfoSerde {
|
||||
username: pi.username.clone(),
|
||||
@@ -1407,6 +1412,14 @@ impl LoginConfigHandler {
|
||||
log::debug!("remove password of {}", self.id);
|
||||
}
|
||||
}
|
||||
if config.keyboard_mode == "" {
|
||||
if hbb_common::get_version_number(&pi.version) < hbb_common::get_version_number("1.2.0")
|
||||
{
|
||||
config.keyboard_mode = "legacy".to_string();
|
||||
} else {
|
||||
config.keyboard_mode = "map".to_string();
|
||||
}
|
||||
}
|
||||
self.conn_id = pi.conn_id;
|
||||
// no matter if change, for update file time
|
||||
self.save_config(config);
|
||||
@@ -2024,8 +2037,3 @@ fn decode_id_pk(signed: &[u8], key: &sign::PublicKey) -> ResultType<(String, [u8
|
||||
bail!("Wrong public length");
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "android", target_os = "ios", feature = "flutter"))]
|
||||
pub fn disable_keyboard_listening() {
|
||||
crate::ui_session_interface::KEYBOARD_HOOKED.store(true, Ordering::SeqCst);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user