Handlers are defined by this trait they process the events, set their status to either Handled or Ignored (if more data is necessary), and send input to the computer via output
| 34 | /// they process the events, set their status to either Handled or Ignored |
| 35 | /// (if more data is necessary), and send input to the computer via output |
| 36 | pub trait ProcessKeys<T: USBKeyOut> { |
| 37 | fn process_keys(&mut self, events: &mut Vec<(Event, EventStatus)>, output: &mut T) -> HandlerResult; |
| 38 | /// whether this handler is enabled after add_handlers |
| 39 | /// (true for most, false for Layers) |
| 40 | fn default_enabled(&self) -> bool { |
| 41 | true |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | pub enum HandlerResult { |
| 46 | NoOp, |
nothing calls this directly
no outgoing calls
no test coverage detected