Merge pull request #5323 from dignow/refact/android_scroll_event

Refact/android scroll event
This commit is contained in:
RustDesk
2023-08-23 12:51:54 +08:00
committed by GitHub
11 changed files with 398 additions and 115 deletions

View File

@@ -1179,21 +1179,7 @@ pub fn main_load_ab() -> String {
}
pub fn session_send_pointer(session_id: SessionID, msg: String) {
if let Ok(m) = serde_json::from_str::<HashMap<String, serde_json::Value>>(&msg) {
let alt = m.get("alt").is_some();
let ctrl = m.get("ctrl").is_some();
let shift = m.get("shift").is_some();
let command = m.get("command").is_some();
if let Some(touch_event) = m.get("touch") {
if let Some(scale) = touch_event.get("scale") {
if let Some(session) = SESSIONS.read().unwrap().get(&session_id) {
if let Some(scale) = scale.as_i64() {
session.send_touch_scale(scale as _, alt, ctrl, shift, command);
}
}
}
}
}
super::flutter::session_send_pointer(session_id, msg);
}
pub fn session_send_mouse(session_id: SessionID, msg: String) {