1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
extern crate crossterm; use crossterm::event::{poll, read, Event}; extern crate std; use std::time::Duration; use crate::errors::UserError; pub fn catch_events() -> UserError { if poll(Duration::from_nanos(1)).unwrap() { match read().unwrap() { Event::Resize(_, _) => { return UserError::ResizeCheck }, _ => {}, } } UserError::NoneError }