fix format

This commit is contained in:
chiehw 2023-03-20 10:13:06 +08:00
parent 6ffa2cacb1
commit 44560b687e
3 changed files with 17 additions and 13 deletions

View File

@ -791,9 +791,10 @@ fn try_fill_unicode(event: &Event, key_event: &KeyEvent, events: &mut Vec<KeyEve
}
}
}
None => {
None =>
{
#[cfg(target_os = "windows")]
if is_hot_key_modifiers_down() && unsafe { !IS_0X021D_DOWN }{
if is_hot_key_modifiers_down() && unsafe { !IS_0X021D_DOWN } {
if let Some(chr) = get_char_by_vk(event.code as u32) {
let mut evt = key_event.clone();
evt.set_seq(chr.to_string());
@ -802,7 +803,6 @@ fn try_fill_unicode(event: &Event, key_event: &KeyEvent, events: &mut Vec<KeyEve
}
}
}
}
#[cfg(target_os = "windows")]

View File

@ -17,7 +17,6 @@ pub mod delegate;
#[cfg(target_os = "linux")]
pub mod linux;
use crate::input_service::clear_remapped_keycode;
#[cfg(not(any(target_os = "android", target_os = "ios")))]
use hbb_common::{message_proto::CursorData, ResultType};
#[cfg(not(target_os = "macos"))]
@ -44,7 +43,7 @@ pub fn is_xfce() -> bool {
pub fn breakdown_callback() {
#[cfg(target_os = "linux")]
clear_remapped_keycode()
crate::input_service::clear_remapped_keycode()
}
// Android

View File

@ -27,8 +27,8 @@ use winapi::{
handleapi::CloseHandle,
minwinbase::STILL_ACTIVE,
processthreadsapi::{
GetCurrentProcess, GetCurrentProcessId, GetCurrentThreadId, GetExitCodeProcess,
OpenProcess, OpenProcessToken, PROCESS_INFORMATION, STARTUPINFOW,
GetCurrentProcess, GetCurrentProcessId, GetExitCodeProcess, OpenProcess,
OpenProcessToken, PROCESS_INFORMATION, STARTUPINFOW,
},
securitybaseapi::GetTokenInformation,
shellapi::ShellExecuteW,
@ -1948,7 +1948,8 @@ mod cert {
RegKey,
};
const ROOT_CERT_STORE_PATH: &str = "SOFTWARE\\Microsoft\\SystemCertificates\\ROOT\\Certificates\\";
const ROOT_CERT_STORE_PATH: &str =
"SOFTWARE\\Microsoft\\SystemCertificates\\ROOT\\Certificates\\";
const THUMBPRINT_ALG: ALG_ID = CALG_SHA1;
const THUMBPRINT_LEN: DWORD = 20;
@ -1966,7 +1967,10 @@ mod cert {
&mut size,
) == TRUE
{
(thumbprint.to_vec(), hex::encode(thumbprint).to_ascii_uppercase())
(
thumbprint.to_vec(),
hex::encode(thumbprint).to_ascii_uppercase(),
)
} else {
(thumbprint.to_vec(), "".to_owned())
}
@ -2074,9 +2078,9 @@ mod cert {
}
pub fn get_char_by_vk(vk: u32) -> Option<char> {
const BUF_LEN: i32 = 32;
let mut buff = [0_u16; BUF_LEN as usize];
let buff_ptr = buff.as_mut_ptr();
const BUF_LEN: i32 = 32;
let len = unsafe {
let current_window_thread_id = GetWindowThreadProcessId(GetForegroundWindow(), null_mut());
let layout = GetKeyboardLayout(current_window_thread_id);
@ -2095,8 +2099,6 @@ pub fn get_char_by_vk(vk: u32) -> Option<char> {
if shift_left || shift_right {
state[VK_SHIFT as usize] = press_state;
}
buff = [0; 32];
let buff_ptr = buff.as_mut_ptr();
ToUnicodeEx(vk, 0x00, &state as _, buff_ptr, BUF_LEN, 0, layout)
};
if len == 1 {
@ -2123,7 +2125,10 @@ mod tests {
use super::*;
#[test]
fn test_install_cert() {
println!("install driver cert: {:?}", cert::install_cert("RustDeskIddDriver.cer"));
println!(
"install driver cert: {:?}",
cert::install_cert("RustDeskIddDriver.cer")
);
}
#[test]