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
| 11 | /// but consider using the constants in UserKey::* |
| 12 | /// which is not used by either UnicodeKeyboard or UsbKeyboard |
| 13 | pub struct PressMacro<M> { |
| 14 | keycode: u32, |
| 15 | callback: M, |
| 16 | } |
| 17 | impl<M: Action> PressMacro<M> { |
| 18 | pub fn new(trigger: impl AcceptsKeycode, callback: M) -> PressMacro<M> { |
| 19 | PressMacro { |
nothing calls this directly
no outgoing calls
no test coverage detected