fix conflict
This commit is contained in:
parent
95775678ca
commit
49bcf8f794
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -4229,7 +4229,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "rdev"
|
||||
version = "0.5.0-2"
|
||||
source = "git+https://github.com/asur4s/rdev#fdcee04f10ea0ef00d36aa612eabb9605ae9f2fc"
|
||||
source = "git+https://github.com/asur4s/rdev#4051761e7ccf434a443b8e9592c23160c9cace56"
|
||||
dependencies = [
|
||||
"cocoa",
|
||||
"core-foundation 0.9.3",
|
||||
|
@ -7,7 +7,7 @@ packages:
|
||||
name: _fe_analyzer_shared
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "50.0.0"
|
||||
version: "49.0.0"
|
||||
after_layout:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -21,7 +21,7 @@ packages:
|
||||
name: analyzer
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "5.2.0"
|
||||
version: "5.1.0"
|
||||
animations:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -35,7 +35,7 @@ packages:
|
||||
name: archive
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.3.5"
|
||||
version: "3.3.1"
|
||||
args:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -64,6 +64,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "6.0.1"
|
||||
bot_toast:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: bot_toast
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.0.3"
|
||||
build:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -77,7 +84,7 @@ packages:
|
||||
name: build_config
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.1"
|
||||
version: "1.1.0"
|
||||
build_daemon:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -98,14 +105,14 @@ packages:
|
||||
name: build_runner
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.3.2"
|
||||
version: "2.2.1"
|
||||
build_runner_core:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build_runner_core
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "7.2.7"
|
||||
version: "7.2.4"
|
||||
built_collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -119,7 +126,7 @@ packages:
|
||||
name: built_value
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "8.4.2"
|
||||
version: "8.4.1"
|
||||
cached_network_image:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -196,7 +203,7 @@ packages:
|
||||
name: convert
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.1.0"
|
||||
version: "3.0.2"
|
||||
cross_file:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -257,8 +264,8 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: "."
|
||||
ref: bf278fc8a8ff787e46fa3ab97674373bfaa20f23
|
||||
resolved-ref: bf278fc8a8ff787e46fa3ab97674373bfaa20f23
|
||||
ref: "82f9eab81cb2c7bfb938def7a1b399a6279bbc75"
|
||||
resolved-ref: "82f9eab81cb2c7bfb938def7a1b399a6279bbc75"
|
||||
url: "https://github.com/Kingtous/rustdesk_desktop_multi_window"
|
||||
source: git
|
||||
version: "0.1.0"
|
||||
@ -345,7 +352,7 @@ packages:
|
||||
name: file_picker
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "5.2.2"
|
||||
version: "5.2.1"
|
||||
fixnum:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -383,8 +390,8 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: "."
|
||||
ref: dec2166e881c47d922e1edc484d10d2cd5c2103b
|
||||
resolved-ref: dec2166e881c47d922e1edc484d10d2cd5c2103b
|
||||
ref: "74b1b314142b6775c1243067a3503ac568ebc74b"
|
||||
resolved-ref: "74b1b314142b6775c1243067a3503ac568ebc74b"
|
||||
url: "https://github.com/Kingtous/rustdesk_flutter_custom_cursor"
|
||||
source: git
|
||||
version: "0.0.1"
|
||||
@ -436,7 +443,7 @@ packages:
|
||||
name: flutter_svg
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.6"
|
||||
version: "1.1.5"
|
||||
flutter_web_plugins:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
@ -448,21 +455,21 @@ packages:
|
||||
name: freezed
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.2.1"
|
||||
version: "2.1.1"
|
||||
freezed_annotation:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: freezed_annotation
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.2.0"
|
||||
version: "2.1.0"
|
||||
frontend_server_client:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: frontend_server_client
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.2.0"
|
||||
version: "2.1.3"
|
||||
get:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -476,21 +483,21 @@ packages:
|
||||
name: glob
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
version: "2.1.0"
|
||||
graphs:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: graphs
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.2.0"
|
||||
version: "2.1.0"
|
||||
html:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: html
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.15.1"
|
||||
version: "0.15.0"
|
||||
http:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -511,7 +518,7 @@ packages:
|
||||
name: http_parser
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.0.2"
|
||||
version: "4.0.1"
|
||||
icons_launcher:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
@ -525,7 +532,7 @@ packages:
|
||||
name: image
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.2.2"
|
||||
version: "3.2.0"
|
||||
image_picker:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -595,7 +602,7 @@ packages:
|
||||
name: lints
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
version: "2.0.0"
|
||||
logging:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -728,7 +735,7 @@ packages:
|
||||
name: path_provider_android
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.22"
|
||||
version: "2.0.20"
|
||||
path_provider_ios:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -792,13 +799,6 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.3"
|
||||
pointycastle:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pointycastle
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.6.2"
|
||||
pool:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -819,14 +819,14 @@ packages:
|
||||
name: provider
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "6.0.4"
|
||||
version: "6.0.3"
|
||||
pub_semver:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pub_semver
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.3"
|
||||
version: "2.1.1"
|
||||
pubspec_parse:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -847,7 +847,7 @@ packages:
|
||||
name: rxdart
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.27.7"
|
||||
version: "0.27.5"
|
||||
screen_retriever:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -884,7 +884,7 @@ packages:
|
||||
name: shelf_web_socket
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.3"
|
||||
version: "1.0.2"
|
||||
simple_observable:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -903,7 +903,7 @@ packages:
|
||||
name: source_gen
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.6"
|
||||
version: "1.2.5"
|
||||
source_span:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -924,7 +924,7 @@ packages:
|
||||
name: sqflite_common
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.4.0"
|
||||
version: "2.3.0"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -945,7 +945,7 @@ packages:
|
||||
name: stream_transform
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
version: "2.0.1"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -1008,7 +1008,7 @@ packages:
|
||||
name: uni_links_desktop
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.1.3"
|
||||
version: "0.1.4"
|
||||
uni_links_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -1036,14 +1036,14 @@ packages:
|
||||
name: url_launcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "6.1.7"
|
||||
version: "6.1.6"
|
||||
url_launcher_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: url_launcher_android
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "6.0.22"
|
||||
version: "6.0.19"
|
||||
url_launcher_ios:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -1092,7 +1092,7 @@ packages:
|
||||
name: uuid
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.7"
|
||||
version: "3.0.6"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -1106,7 +1106,7 @@ packages:
|
||||
name: video_player
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.4.8"
|
||||
version: "2.4.7"
|
||||
video_player_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -1183,7 +1183,7 @@ packages:
|
||||
name: watcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.2"
|
||||
version: "1.0.1"
|
||||
web_socket_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -1197,7 +1197,7 @@ packages:
|
||||
name: win32
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.1.2"
|
||||
version: "3.0.0"
|
||||
win32_registry:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -285,7 +285,7 @@ pub fn session_handle_flutter_key_event(
|
||||
down_or_up: bool,
|
||||
) {
|
||||
if let Some(session) = SESSIONS.read().unwrap().get(&id) {
|
||||
// session.handle_flutter_key_event(&name, keycode, scancode, down_or_up);
|
||||
session.handle_flutter_key_event(&name, keycode, scancode, down_or_up);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,10 @@
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
use crate::client::get_key_state;
|
||||
use crate::common::GrabState;
|
||||
#[cfg(feature = "flutter")]
|
||||
use crate::flutter::FlutterHandler;
|
||||
#[cfg(not(feature = "flutter"))]
|
||||
use crate::ui::remote::SciterHandler;
|
||||
use crate::ui_session_interface::Session;
|
||||
use hbb_common::{log, message_proto::*};
|
||||
use rdev::{Event, EventType, Key};
|
||||
@ -16,10 +19,18 @@ use std::time::SystemTime;
|
||||
static mut IS_ALT_GR: bool = false;
|
||||
pub static KEYBOARD_HOOKED: AtomicBool = AtomicBool::new(false);
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
pub static ref GRAB_SENDER: Arc<Mutex<Option<mpsc::Sender<GrabState>>>> = Default::default();
|
||||
}
|
||||
|
||||
#[cfg(feature = "flutter")]
|
||||
lazy_static::lazy_static! {
|
||||
pub static ref CUR_SESSION: Arc<Mutex<Option<Session<FlutterHandler>>>> = Default::default();
|
||||
pub static ref GRAB_SENDER: Arc<Mutex<Option<mpsc::Sender<GrabState>>>> = Default::default();
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "flutter"))]
|
||||
lazy_static::lazy_static! {
|
||||
pub static ref CUR_SESSION: Arc<Mutex<Option<Session<SciterHandler>>>> = Default::default();
|
||||
}
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
@ -50,19 +61,12 @@ pub mod client {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn save_keyboard_mode(value: String) {
|
||||
release_remote_keys();
|
||||
if let Some(handler) = CUR_SESSION.lock().unwrap().as_mut() {
|
||||
handler.save_keyboard_mode(value);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn start_grab_loop() {
|
||||
let (sender, receiver) = mpsc::channel::<GrabState>();
|
||||
unsafe {
|
||||
grab_loop(receiver);
|
||||
*GRAB_SENDER.lock().unwrap() = Some(sender);
|
||||
}
|
||||
|
||||
grab_loop(receiver);
|
||||
*GRAB_SENDER.lock().unwrap() = Some(sender);
|
||||
|
||||
change_grab_status(GrabState::Ready);
|
||||
}
|
||||
|
||||
@ -70,11 +74,8 @@ pub mod client {
|
||||
if GrabState::Wait == state {
|
||||
release_remote_keys();
|
||||
}
|
||||
unsafe {
|
||||
if let Some(sender) = &*GRAB_SENDER.lock().unwrap() {
|
||||
log::info!("grab state: {:?}", state);
|
||||
sender.send(state);
|
||||
}
|
||||
if let Some(sender) = &*GRAB_SENDER.lock().unwrap() {
|
||||
sender.send(state).ok();
|
||||
}
|
||||
}
|
||||
|
||||
@ -83,7 +84,6 @@ pub mod client {
|
||||
return;
|
||||
}
|
||||
let key_event = event_to_key_event(&event);
|
||||
log::info!("key event: {:?}", key_event);
|
||||
send_key_event(&key_event);
|
||||
}
|
||||
|
||||
@ -103,9 +103,10 @@ pub mod client {
|
||||
let command = *modifiers_lock.get(&Key::MetaLeft).unwrap()
|
||||
|| *modifiers_lock.get(&Key::MetaRight).unwrap()
|
||||
|| command;
|
||||
let alt =
|
||||
*modifiers_lock.get(&Key::Alt).unwrap() || *modifiers_lock.get(&Key::AltGr).unwrap() || alt;
|
||||
|
||||
let alt = *modifiers_lock.get(&Key::Alt).unwrap()
|
||||
|| *modifiers_lock.get(&Key::AltGr).unwrap()
|
||||
|| alt;
|
||||
|
||||
(alt, ctrl, shift, command)
|
||||
}
|
||||
|
||||
@ -229,7 +230,7 @@ pub fn grab_loop(recv: mpsc::Receiver<GrabState>) {
|
||||
}
|
||||
|
||||
pub fn is_long_press(event: &Event) -> bool {
|
||||
let mut keys = MODIFIERS_STATE.lock().unwrap();
|
||||
let keys = MODIFIERS_STATE.lock().unwrap();
|
||||
match event.event_type {
|
||||
EventType::KeyPress(k) => {
|
||||
if let Some(&state) = keys.get(&k) {
|
||||
@ -251,12 +252,11 @@ pub fn release_remote_keys() {
|
||||
for key in keys {
|
||||
let event_type = EventType::KeyRelease(key);
|
||||
let event = event_type_to_event(event_type);
|
||||
log::info!("release key: {:?}", key);
|
||||
client::process_event(event);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_keyboard_mode_enum() -> KeyboardMode {
|
||||
pub fn get_keyboard_mode_enum() -> KeyboardMode {
|
||||
match client::get_keyboard_mode().as_str() {
|
||||
"map" => KeyboardMode::Map,
|
||||
"translate" => KeyboardMode::Translate,
|
||||
@ -264,6 +264,7 @@ pub fn get_keyboard_mode_enum() -> KeyboardMode {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
pub fn add_numlock_capslock_state(key_event: &mut KeyEvent) {
|
||||
if get_key_state(enigo::Key::CapsLock) {
|
||||
key_event.modifiers.push(ControlKey::CapsLock.into());
|
||||
@ -273,6 +274,7 @@ pub fn add_numlock_capslock_state(key_event: &mut KeyEvent) {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
pub fn convert_numpad_keys(key: Key) -> Key {
|
||||
if get_key_state(enigo::Key::NumLock) {
|
||||
return key;
|
||||
@ -337,6 +339,7 @@ pub fn event_to_key_event(event: &Event) -> KeyEvent {
|
||||
translate_keyboard_mode(event, &mut key_event);
|
||||
}
|
||||
_ => {
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
legacy_keyboard_mode(event, &mut key_event);
|
||||
}
|
||||
};
|
||||
@ -356,10 +359,8 @@ pub fn event_type_to_event(event_type: EventType) -> Event {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "flutter")]
|
||||
pub fn send_key_event(key_event: &KeyEvent) {
|
||||
if let Some(handler) = CUR_SESSION.lock().unwrap().as_ref() {
|
||||
log::info!("Sending key even {:?}", key_event);
|
||||
handler.send_key_event(key_event);
|
||||
}
|
||||
}
|
||||
@ -373,6 +374,7 @@ pub fn get_peer_platform() -> String {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
pub fn legacy_keyboard_mode(event: &Event, key_event: &mut KeyEvent) {
|
||||
// legacy mode(0): Generate characters locally, look for keycode on other side.
|
||||
let (mut key, down_or_up) = match event.event_type {
|
||||
@ -616,4 +618,4 @@ pub fn map_keyboard_mode(event: &Event, key_event: &mut KeyEvent) {
|
||||
key_event.set_chr(keycode);
|
||||
}
|
||||
|
||||
pub fn translate_keyboard_mode(event: &Event, key_event: &mut KeyEvent) {}
|
||||
pub fn translate_keyboard_mode(_event: &Event, _key_event: &mut KeyEvent) {}
|
||||
|
@ -764,11 +764,6 @@ fn rdev_key_down_or_up(key: RdevKey, down_or_up: bool) {
|
||||
std::thread::sleep(Duration::from_millis(20));
|
||||
}
|
||||
|
||||
fn rdev_key_click(key: RdevKey) {
|
||||
rdev_key_down_or_up(key, true);
|
||||
rdev_key_down_or_up(key, false);
|
||||
}
|
||||
|
||||
fn sync_status(evt: &KeyEvent) {
|
||||
let mut en = ENIGO.lock().unwrap();
|
||||
|
||||
|
@ -4,8 +4,7 @@ use crate::client::{
|
||||
load_config, send_mouse, start_video_audio_threads, FileManager, Key, LoginConfigHandler,
|
||||
QualityStatus, KEY_MAP,
|
||||
};
|
||||
#[cfg(target_os = "linux")]
|
||||
use crate::common::IS_X11;
|
||||
use crate::common::GrabState;
|
||||
use crate::{client::Data, client::Interface};
|
||||
use async_trait::async_trait;
|
||||
use hbb_common::config::{Config, LocalConfig, PeerConfig};
|
||||
@ -17,7 +16,8 @@ use std::collections::HashMap;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
|
||||
use std::sync::{Arc, Mutex, RwLock};
|
||||
|
||||
use crate::keyboard;
|
||||
use rdev::{Event, EventType::*};
|
||||
pub static IS_IN: AtomicBool = AtomicBool::new(false);
|
||||
|
||||
#[derive(Clone, Default)]
|
||||
@ -292,7 +292,7 @@ impl<T: InvokeUiSession> Session<T> {
|
||||
return "".to_owned();
|
||||
}
|
||||
|
||||
pub fn send_key_event(&self, mut evt: &KeyEvent) {
|
||||
pub fn send_key_event(&self, evt: &KeyEvent) {
|
||||
// mode: legacy(0), map(1), translate(2), auto(3)
|
||||
let mut msg_out = Message::new();
|
||||
msg_out.set_key_event(evt.clone());
|
||||
@ -362,6 +362,40 @@ impl<T: InvokeUiSession> Session<T> {
|
||||
self.send(Data::Message(msg_out));
|
||||
}
|
||||
|
||||
pub fn handle_flutter_key_event(
|
||||
&self,
|
||||
name: &str,
|
||||
keycode: i32,
|
||||
scancode: i32,
|
||||
down_or_up: bool,
|
||||
) {
|
||||
if scancode < 0 || keycode < 0 {
|
||||
return;
|
||||
}
|
||||
let keycode: u32 = keycode as u32;
|
||||
let scancode: u32 = scancode as u32;
|
||||
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
let key = rdev::key_from_scancode(scancode) as rdev::Key;
|
||||
// Windows requires special handling
|
||||
#[cfg(target_os = "windows")]
|
||||
let key = rdev::get_win_key(keycode, scancode);
|
||||
|
||||
let event_type = if down_or_up {
|
||||
KeyPress(key)
|
||||
} else {
|
||||
KeyRelease(key)
|
||||
};
|
||||
let event = Event {
|
||||
time: std::time::SystemTime::now(),
|
||||
name: Option::Some(name.to_owned()),
|
||||
code: keycode as _,
|
||||
scan_code: scancode as _,
|
||||
event_type: event_type,
|
||||
};
|
||||
keyboard::client::process_event(event);
|
||||
}
|
||||
|
||||
// flutter only TODO new input
|
||||
fn _input_key(
|
||||
&self,
|
||||
@ -423,7 +457,6 @@ impl<T: InvokeUiSession> Session<T> {
|
||||
}
|
||||
}
|
||||
|
||||
// todo! chieh
|
||||
// #[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
let (alt, ctrl, shift, command) =
|
||||
keyboard::client::get_modifiers_state(alt, ctrl, shift, command);
|
||||
|
Loading…
Reference in New Issue
Block a user