mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
set map as default keyboard mode
This commit is contained in:
@@ -48,7 +48,7 @@ pub use super::lang::*;
|
||||
pub mod file_trait;
|
||||
pub mod helper;
|
||||
pub mod io_loop;
|
||||
|
||||
use crate::ui_session_interface::global_save_keyboard_mode;
|
||||
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);
|
||||
@@ -1294,6 +1294,9 @@ 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(),
|
||||
|
||||
@@ -80,13 +80,11 @@ impl<T: InvokeUiSession> Session<T> {
|
||||
}
|
||||
|
||||
pub fn get_keyboard_mode(&self) -> String {
|
||||
return std::env::var("KEYBOARD_MODE")
|
||||
.unwrap_or(String::from("legacy"))
|
||||
.to_lowercase();
|
||||
global_get_keyboard_mode()
|
||||
}
|
||||
|
||||
pub fn save_keyboard_mode(&self, value: String) {
|
||||
std::env::set_var("KEYBOARD_MODE", value);
|
||||
global_save_keyboard_mode(value);
|
||||
}
|
||||
|
||||
pub fn save_view_style(&mut self, value: String) {
|
||||
@@ -1550,3 +1548,13 @@ async fn send_note(url: String, id: String, conn_id: i32, note: String) {
|
||||
fn get_hotkey_state(key: RdevKey) -> bool {
|
||||
*MUTEX_SPECIAL_KEYS.lock().unwrap().get(&key).unwrap()
|
||||
}
|
||||
|
||||
pub fn global_get_keyboard_mode() -> String {
|
||||
return std::env::var("KEYBOARD_MODE")
|
||||
.unwrap_or(String::from("map"))
|
||||
.to_lowercase();
|
||||
}
|
||||
|
||||
pub fn global_save_keyboard_mode(value: String) {
|
||||
std::env::set_var("KEYBOARD_MODE", value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user