MCPcopy Create free account
hub / github.com/TyberiusPrime/KeyToKey / toggle_handler

Function toggle_handler

src/premade.rs:29–37  ·  view source on GitHub ↗

Toggles a handler on and off when a key is pressed

(
    trigger: impl AcceptsKeycode,
    id: HandlerID,
)

Source from the content-addressed store, hash-verified

27
28/// Toggles a handler on and off when a key is pressed
29pub fn toggle_handler(
30 trigger: impl AcceptsKeycode,
31 id: HandlerID,
32) -> Box<PressReleaseMacro<ActionToggleHandler>> {
33 Box::new(PressReleaseMacro::new(
34 trigger.to_u32(),
35 ActionToggleHandler { id },
36 ))
37}
38/// A layer that maps qwerty to dvorak.
39/// Don't forget to enable it, layers are off by default
40pub fn dvorak() -> Box<RewriteLayer> {

Callers 1

test_toggle_handlerFunction · 0.85

Calls 1

to_u32Method · 0.80

Tested by 1

test_toggle_handlerFunction · 0.68