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

Class PressReleaseMacro

src/handlers/macros.rs:56–59  ·  view source on GitHub ↗

A simple callback - call on_press(output: impl USBKeyOut) on key press and on_release(output) 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

54/// but consider using the constants in UserKey::*
55/// which is not used by either UnicodeKeyboard or UsbKeyboard
56pub struct PressReleaseMacro<M> {
57 keycode: u32,
58 callbacks: M,
59}
60impl<M: OnOff> PressReleaseMacro<M> {
61 pub fn new(trigger: impl AcceptsKeycode, callbacks: M) -> PressReleaseMacro<M> {
62 PressReleaseMacro {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected