Add richer API for describing global shortcut accelerators.

This commit is contained in:
Nolan Darilek committed 2023-06-30 08:10:48 -05:00
1 parent f4e1d78d7a
commit c84e028bd6
3 files changed
+37 -27

No files matched your search

+1 -1
View File
@@ -8,7 +8,7 @@ fn main() {
fn app(cx: Scope) -> Element {
let toggled = use_state(cx, || false);
use_global_shortcut(cx, KeyCode::S, ModifiersState::CONTROL, {
use_global_shortcut(cx, "ctrl+s", {
to_owned![toggled];
move || toggled.modify(|t| !*t)
});