mirror of
https://github.com/0PandaDEV/Qopy.git
synced 2025-04-22 05:34:04 +02:00
back to normal setup methods
This commit is contained in:
parent
69686f7514
commit
75583ac6ce
6 changed files with 56 additions and 106 deletions
|
@ -1,18 +1,9 @@
|
|||
use tauri::plugin::TauriPlugin;
|
||||
use tauri::Manager;
|
||||
use rdev::{listen, EventType, Key};
|
||||
use crate::utils::commands;
|
||||
use tauri::Manager;
|
||||
|
||||
pub fn init() -> TauriPlugin<tauri::Wry> {
|
||||
tauri::plugin::Builder::new("hotkeys")
|
||||
.setup(|app, _| {
|
||||
setup(app.app_handle().clone());
|
||||
Ok(())
|
||||
})
|
||||
.build()
|
||||
}
|
||||
use crate::utils::commands::center_window_on_current_monitor;
|
||||
|
||||
fn setup(app_handle: tauri::AppHandle) {
|
||||
pub fn setup(app_handle: tauri::AppHandle) {
|
||||
std::thread::spawn(move || {
|
||||
let mut meta_pressed = false;
|
||||
listen(move |event| {
|
||||
|
@ -29,7 +20,7 @@ fn setup(app_handle: tauri::AppHandle) {
|
|||
let window = app_handle.get_webview_window("main").unwrap();
|
||||
window.show().unwrap();
|
||||
window.set_focus().unwrap();
|
||||
commands::center_window_on_current_monitor(&window);
|
||||
center_window_on_current_monitor(&window);
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue