feat: add specific keyboard hook

This commit is contained in:
kingtous 2022-06-27 09:25:20 +08:00
parent c1cf9307ac
commit f2460c26ca
3 changed files with 19 additions and 2 deletions

View File

@ -630,8 +630,17 @@ class _RemotePageState extends State<RemotePage>
id: widget.id,
));
}
return Container(
color: MyTheme.canvasColor, child: Stack(children: paints));
paints.add(getHelpTools());
return MouseRegion(
onEnter: (evt) {
_ffi.bind.hostStopSystemKeyPropagate(stopped: false);
},
onExit: (evt) {
_ffi.bind.hostStopSystemKeyPropagate(stopped: true);
},
child: Container(
color: MyTheme.canvasColor, child: Stack(children: paints)),
);
}
int lastMouseDownButtons = 0;

View File

@ -21,6 +21,8 @@ void wire_rustdesk_core_main(int64_t port_);
void wire_start_global_event_stream(int64_t port_);
void wire_host_stop_system_key_propagate(int64_t port_, bool stopped);
void wire_session_connect(int64_t port_, struct wire_uint_8_list *id, bool is_file_transfer);
void wire_get_session_remember(int64_t port_, struct wire_uint_8_list *id);
@ -170,6 +172,7 @@ static int64_t dummy_method_to_enforce_bundling(void) {
int64_t dummy_var = 0;
dummy_var ^= ((int64_t) (void*) wire_rustdesk_core_main);
dummy_var ^= ((int64_t) (void*) wire_start_global_event_stream);
dummy_var ^= ((int64_t) (void*) wire_host_stop_system_key_propagate);
dummy_var ^= ((int64_t) (void*) wire_session_connect);
dummy_var ^= ((int64_t) (void*) wire_get_session_remember);
dummy_var ^= ((int64_t) (void*) wire_get_session_toggle_option);

View File

@ -69,6 +69,11 @@ pub fn start_global_event_stream(s: StreamSink<String>) -> ResultType<()> {
Ok(())
}
pub fn host_stop_system_key_propagate(stopped: bool) {
#[cfg(windows)]
crate::platform::windows::stop_system_key_propagate(stopped);
}
pub fn session_connect(
events2ui: StreamSink<EventToUI>,
id: String,