Hello,
I've made the following function which is a simplification of my app problem :
fn hotkeys(app: tauri::AppHandle){
println!("register Insert key");
let mut shortcuts = app.global_shortcut_manager();
shortcuts.register("Insert", {
let app = app.clone();
move || {
let mut shortcuts = app.global_shortcut_manager();
println!("register Esc key");
shortcuts.register("Esc", || {}).expect("ERROR register Esc key");
println!("After register Esc key");
}
}).expect("ERROR register Insert key");
}
The problem is that this script makes the app freeze when I press the "Insert" key.
Logs print "register Esc key" and then nothing. It doesn't reach "ERROR register Esc key" and "After register Esc key" neither. The window of my app gets stuck too.
May anyone explain me why this behaviour and give me a solution ?
Thanks !