Replies: 2 comments
-
If you want to completely close the window instead of hiding you indeed need to use Rust to register it instead, because without a window the js code can't run. tauri/examples/api/src-tauri/src/main.rs Lines 197 to 209 in b02fc90 |
Beta Was this translation helpful? Give feedback.
-
I have the same use case aswell, opening an overlay on a Keyboard shortcut. I got it working but i wonder if it would be better to hide the window instead of closing. It does feel a little more responsive. Is there a best practice? |
Beta Was this translation helpful? Give feedback.
-
I'm working on a raycast / alfred type of launcher, which users should be able to open with a simple keyboard combination, even if there is no tauri window open.
I tried using the
@tauri-apps/api/globalShortcut
register
API, but that no longer works when the window is closed. I could keep the window open by callinghide
on it, but that seems like an ugly solution.Maybe I'm missing an API (on the Rust side), or maybe I should use a radically different approach.
Beta Was this translation helpful? Give feedback.
All reactions