(&mut self, events: &mut Vec<(Event, EventStatus)>, output: &mut T)
| 50 | pub struct TranslationHelper {} |
| 51 | impl<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 |
nothing calls this directly
no test coverage detected