fix win, local detect some dead code

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-01-27 23:45:07 +08:00
parent a529b14f2d
commit bf04a03cd1
3 changed files with 19 additions and 2 deletions

View File

@@ -64,6 +64,8 @@ pub mod client {
match state {
GrabState::Ready => {}
GrabState::Run => {
#[cfg(windows)]
update_grab_get_key_name();
#[cfg(any(target_os = "windows", target_os = "macos"))]
KEYBOARD_HOOKED.swap(true, Ordering::SeqCst);
@@ -184,6 +186,15 @@ pub mod client {
}
}
#[cfg(windows)]
pub fn update_grab_get_key_name() {
match get_keyboard_mode_enum() {
KeyboardMode::Map => rdev::set_get_key_name(false),
KeyboardMode::Translate => rdev::set_get_key_name(true),
_ => {}
};
}
pub fn start_grab_loop() {
#[cfg(any(target_os = "windows", target_os = "macos"))]
std::thread::spawn(move || {