mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-27 06:30:20 +00:00
14 lines
272 B
Rust
14 lines
272 B
Rust
use dioxus::desktop::use_global_shortcut;
|
|
use dioxus::prelude::*;
|
|
|
|
fn main() {
|
|
launch_desktop(app);
|
|
}
|
|
|
|
fn app() -> Element {
|
|
let mut toggled = use_signal(|| false);
|
|
|
|
_ = use_global_shortcut("ctrl+s", move || toggled.toggle());
|
|
|
|
rsx!("toggle: {toggled}")
|
|
}
|