| 1 | //! Demonstrating how to monitor events with evdev + tokio |
| 2 | |
| 3 | // cli/"tui" shared between the evtest examples |
| 4 | mod _pick_device; |
| 5 | |
| 6 | #[tokio::main] |
| 7 | async fn main() -> Result<(), Box<dyn std::error::Error>> { |
| 8 | let d = _pick_device::pick_device(); |
| 9 | println!("{}", d); |
| 10 | println!("Events:"); |
| 11 | let mut events = d.into_event_stream()?; |
| 12 | loop { |
| 13 | let ev = events.next_event().await?; |
| 14 | println!("{:?}", ev); |
| 15 | } |
| 16 | } |