mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-28 15:49:04 +08:00
Refactor: env of keyboard mode
This commit is contained in:
parent
abf79ba61d
commit
925a9e43cb
@ -711,3 +711,14 @@ pub fn make_fd_flutter(id: i32, entries: &Vec<FileEntry>, only_count: bool) -> S
|
||||
m.insert("total_size".into(), json!(n as f64));
|
||||
serde_json::to_string(&m).unwrap_or("".into())
|
||||
}
|
||||
|
||||
|
||||
pub fn get_keyboard_mode() -> String {
|
||||
return std::env::var("KEYBOARD_MODE")
|
||||
.unwrap_or(String::from("legacy"))
|
||||
.to_lowercase();
|
||||
}
|
||||
|
||||
pub fn save_keyboard_mode(value: String) {
|
||||
std::env::set_var("KEYBOARD_MODE", value);
|
||||
}
|
@ -1,3 +1,4 @@
|
||||
use crate::common::{get_keyboard_mode, save_keyboard_mode};
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
ops::{Deref, DerefMut},
|
||||
|
@ -7,6 +7,7 @@ use crate::client::{
|
||||
QualityStatus, KEY_MAP, SERVER_KEYBOARD_ENABLED,
|
||||
};
|
||||
use crate::{client::Data, client::Interface};
|
||||
use crate::common::{get_keyboard_mode, save_keyboard_mode};
|
||||
use async_trait::async_trait;
|
||||
|
||||
use hbb_common::config::{Config, LocalConfig, PeerConfig};
|
||||
@ -58,13 +59,11 @@ impl<T: InvokeUi> Session<T> {
|
||||
}
|
||||
|
||||
pub fn get_keyboard_mode(&self) -> String {
|
||||
return std::env::var("KEYBOARD_MODE")
|
||||
.unwrap_or(String::from("legacy"))
|
||||
.to_lowercase();
|
||||
return get_keyboard_mode();
|
||||
}
|
||||
|
||||
pub fn save_keyboard_mode(&self, value: String) {
|
||||
std::env::set_var("KEYBOARD_MODE", value);
|
||||
save_keyboard_mode(value);
|
||||
}
|
||||
|
||||
pub fn save_view_style(&mut self, value: String) {
|
||||
|
Loading…
Reference in New Issue
Block a user