Add richer API for describing global shortcut accelerators.
This commit is contained in:
1 parent
f4e1d78d7a
commit
c84e028bd6
3 files changed
+37
-27
No files matched your search
@@ -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)
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user