set map as default keyboard mode
This commit is contained in:
parent
01875a562c
commit
f2a5b77d7a
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -4126,7 +4126,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "rdev"
|
name = "rdev"
|
||||||
version = "0.5.0-2"
|
version = "0.5.0-2"
|
||||||
source = "git+https://github.com/asur4s/rdev#71a2b9e014b5aaeb85d7bb4a5b7562e3a68cc509"
|
source = "git+https://github.com/asur4s/rdev#22c8a6474065f03ecbddef7f47de0539ff3f5c4f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cocoa",
|
"cocoa",
|
||||||
"core-foundation 0.9.3",
|
"core-foundation 0.9.3",
|
||||||
|
@ -48,7 +48,7 @@ pub use super::lang::*;
|
|||||||
pub mod file_trait;
|
pub mod file_trait;
|
||||||
pub mod helper;
|
pub mod helper;
|
||||||
pub mod io_loop;
|
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_KEYBOARD_ENABLED: AtomicBool = AtomicBool::new(true);
|
||||||
pub static SERVER_FILE_TRANSFER_ENABLED: AtomicBool = AtomicBool::new(true);
|
pub static SERVER_FILE_TRANSFER_ENABLED: AtomicBool = AtomicBool::new(true);
|
||||||
pub static SERVER_CLIPBOARD_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() {
|
if !pi.version.is_empty() {
|
||||||
self.version = hbb_common::get_version_number(&pi.version);
|
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();
|
self.features = pi.features.clone().into_option();
|
||||||
let serde = PeerInfoSerde {
|
let serde = PeerInfoSerde {
|
||||||
username: pi.username.clone(),
|
username: pi.username.clone(),
|
||||||
|
@ -80,13 +80,11 @@ impl<T: InvokeUiSession> Session<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_keyboard_mode(&self) -> String {
|
pub fn get_keyboard_mode(&self) -> String {
|
||||||
return std::env::var("KEYBOARD_MODE")
|
global_get_keyboard_mode()
|
||||||
.unwrap_or(String::from("legacy"))
|
|
||||||
.to_lowercase();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn save_keyboard_mode(&self, value: String) {
|
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) {
|
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 {
|
fn get_hotkey_state(key: RdevKey) -> bool {
|
||||||
*MUTEX_SPECIAL_KEYS.lock().unwrap().get(&key).unwrap()
|
*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);
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user