mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
Feat/android more actions (#8496)
* feat: android volume and power actions Signed-off-by: fufesou <linlong1266@gmail.com> * Add translations and refact action menus Signed-off-by: fufesou <linlong1266@gmail.com> * Remove divider Signed-off-by: fufesou <linlong1266@gmail.com> * fix: recover deleted translations Signed-off-by: fufesou <linlong1266@gmail.com> --------- Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -44,7 +44,7 @@ pub(crate) const APP_TYPE_CM: &str = "main";
|
||||
pub type FlutterSession = Arc<Session<FlutterHandler>>;
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
pub(crate) static ref CUR_SESSION_ID: RwLock<SessionID> = Default::default();
|
||||
pub(crate) static ref CUR_SESSION_ID: RwLock<SessionID> = Default::default(); // For desktop only
|
||||
static ref GLOBAL_EVENT_STREAM: RwLock<HashMap<String, StreamSink<String>>> = Default::default(); // rust to dart event channel
|
||||
}
|
||||
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", "Пры кіраванні"),
|
||||
("During service is on", "Пры запушчанай службе"),
|
||||
("Capture screen using DirectX", "Захоп экрана з выкарыстаннем DirectX"),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", "被控期间"),
|
||||
("During service is on", "服务开启期间"),
|
||||
("Capture screen using DirectX", "使用 DirectX 捕获屏幕"),
|
||||
("Back", "回退"),
|
||||
("Apps", "应用"),
|
||||
("Volume up", "提升音量"),
|
||||
("Volume down", "降低音量"),
|
||||
("Power", "电源"),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", "Během řízeného"),
|
||||
("During service is on", "Během služby je v provozu"),
|
||||
("Capture screen using DirectX", "Snímání obrazovky pomocí DirectX"),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", "Wenn kontrolliert"),
|
||||
("During service is on", "Wenn der Dienst läuft"),
|
||||
("Capture screen using DirectX", "Bildschirm mit DirectX aufnehmen"),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", "Mientras está siendo controlado"),
|
||||
("During service is on", "Mientras el servicio está activo"),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", "Durante il controllo"),
|
||||
("During service is on", "Quando il servizio è attivo"),
|
||||
("Capture screen using DirectX", "Cattura schermo usando DirectX"),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", "Lietošanas laikā"),
|
||||
("During service is on", "Kamēr pakalpojums ir ieslēgts"),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", "При управлении"),
|
||||
("During service is on", "При запущенной службе"),
|
||||
("Capture screen using DirectX", "Захват экрана с помощью DirectX"),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", "Počas kontrolovaného"),
|
||||
("During service is on", "Počas služby je v prevádzke"),
|
||||
("Capture screen using DirectX", "Snímanie obrazovky pomocou DirectX"),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", "被控期間"),
|
||||
("During service is on", "服務開啟期間"),
|
||||
("Capture screen using DirectX", "使用 DirectX 擷取螢幕"),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", "Коли керується"),
|
||||
("During service is on", "Коли запущена служба"),
|
||||
("Capture screen using DirectX", "Захоплення екрана з використанням DirectX"),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -622,5 +622,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("During controlled", ""),
|
||||
("During service is on", ""),
|
||||
("Capture screen using DirectX", ""),
|
||||
("Back", ""),
|
||||
("Apps", ""),
|
||||
("Volume up", ""),
|
||||
("Volume down", ""),
|
||||
("Power", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -804,7 +804,54 @@ impl<T: InvokeUiSession> Session<T> {
|
||||
pub fn handle_flutter_key_event(
|
||||
&self,
|
||||
keyboard_mode: &str,
|
||||
_name: &str,
|
||||
name: &str,
|
||||
platform_code: i32,
|
||||
position_code: i32,
|
||||
lock_modes: i32,
|
||||
down_or_up: bool,
|
||||
) {
|
||||
if name == "flutter_key" {
|
||||
self._handle_key_flutter_simulation(keyboard_mode, platform_code, down_or_up);
|
||||
} else {
|
||||
self._handle_key_non_flutter_simulation(
|
||||
keyboard_mode,
|
||||
platform_code,
|
||||
position_code,
|
||||
lock_modes,
|
||||
down_or_up,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "ios")))]
|
||||
fn _handle_key_flutter_simulation(
|
||||
&self,
|
||||
_keyboard_mode: &str,
|
||||
platform_code: i32,
|
||||
down_or_up: bool,
|
||||
) {
|
||||
// https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/services/keyboard_key.g.dart#L4356
|
||||
let ctrl_key = match platform_code {
|
||||
0x0007007f => Some(ControlKey::VolumeMute),
|
||||
0x00070080 => Some(ControlKey::VolumeUp),
|
||||
0x00070081 => Some(ControlKey::VolumeDown),
|
||||
0x00070066 => Some(ControlKey::Power),
|
||||
_ => None,
|
||||
};
|
||||
let Some(ctrl_key) = ctrl_key else { return };
|
||||
let mut key_event = KeyEvent {
|
||||
mode: KeyboardMode::Translate.into(),
|
||||
down: down_or_up,
|
||||
..Default::default()
|
||||
};
|
||||
key_event.set_control_key(ctrl_key);
|
||||
self.send_key_event(&key_event);
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "ios")))]
|
||||
fn _handle_key_non_flutter_simulation(
|
||||
&self,
|
||||
keyboard_mode: &str,
|
||||
platform_code: i32,
|
||||
position_code: i32,
|
||||
lock_modes: i32,
|
||||
|
||||
Reference in New Issue
Block a user