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

Class PressMacro

src/handlers/macros.rs:13–16  ·  view source on GitHub ↗

The simplest callback - call on_trigger on press, nothing on release trigger may be any keycode, but consider using the constants in UserKey:: which is not used by either UnicodeKeyboard or UsbKeyboard

Source from the content-addressed store, hash-verified

11/// but consider using the constants in UserKey::*
12/// which is not used by either UnicodeKeyboard or UsbKeyboard
13pub struct PressMacro<M> {
14 keycode: u32,
15 callback: M,
16}
17impl<M: Action> PressMacro<M> {
18 pub fn new(trigger: impl AcceptsKeycode, callback: M) -> PressMacro<M> {
19 PressMacro {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected