Merge pull request #1057 from ndarilek/master

Add richer API for describing global shortcut accelerators.
This commit is contained in:
Jon Kelley authored and GitHub committed 2023-06-30 12:27:00 -07:00
commit a0b89de4ca
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)
});