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

Method process_keys

src/handlers/debug_handlers.rs:52–74  ·  view source on GitHub ↗
(&mut self, events: &mut Vec<(Event, EventStatus)>, output: &mut T)

Source from the content-addressed store, hash-verified

50pub struct TranslationHelper {}
51impl<T: USBKeyOut> ProcessKeys<T> for TranslationHelper {
52 fn process_keys(&mut self, events: &mut Vec<(Event, EventStatus)>, output: &mut T) ->HandlerResult {
53 for (e, status) in iter_unhandled_mut(events) {
54 *status = EventStatus::Handled;
55 match e {
56 Event::KeyRelease(kc) => {
57 output.send_string(".into(),");
58 output.send_keys(&[KeyCode::Enter]);
59 output.send_empty();
60 let codes = transform_u32_to_keycodes(kc.keycode);
61 for c in &codes {
62 output.send_keys(&[*c]);
63 output.send_empty();
64 }
65 output.send_string("\tKeyCode::");
66 *status = EventStatus::Handled;
67 }
68 _ => {
69 *status = EventStatus::Handled;
70 }
71 };
72 }
73 HandlerResult::NoOp
74 }
75}
76/// Debug a keystream at any point in the handling
77/// by adding a DebugStream with a callback that knows

Callers

nothing calls this directly

Calls 5

iter_unhandled_mutFunction · 0.85
send_stringMethod · 0.80
send_keysMethod · 0.80
send_emptyMethod · 0.80

Tested by

no test coverage detected