()
| 3 | use crossterm::event::{self as term_event, Event as TermEvent, KeyEvent}; |
| 4 | |
| 5 | pub fn poll() -> Option<Event> { |
| 6 | static mut EVENT_RECEIVER: Option<Receiver<Event>> = None; |
| 7 | |
| 8 | if let Ok(true) = term_event::poll(std::time::Duration::from_millis(100)) { |
| 9 | if let Ok(TermEvent::Key(key)) = term_event::read() { |
| 10 | return Some(Event::from_key_event(key)); |
| 11 | } |
| 12 | } |
| 13 | None |
| 14 | } |
| 15 | |
| 16 | #[derive(Clone, Debug)] |
| 17 | pub enum Event { |
nothing calls this directly
no outgoing calls
no test coverage detected