Hey im searching a way to access current window in another thread cause im using a while and its blocking main thread
tauri::Builder::default()
.setup(|app| {
let rx = hookmap_core::install_hook();
while let Ok((event, native_handler)) = rx.recv() {
match event {
Event::Button(event) => {
native_handler.dispatch();
if let Some(window) = app.get_focused_window() {
let cur_keybind = u8_to_button(*CUR_KEYBIND.lock().unwrap().deref());
if cur_keybind == event.target {
let _ = window.emit("keybind_pressed", "".to_string());
println!("test")
}
}
}
_ => {}
}
}
Ok(())
})