thedes_tui_core/input/device/null.rs
1use crate::event::InternalEvent;
2
3use super::{Error, InputDevice};
4
5pub fn open() -> Box<dyn InputDevice> {
6 Box::new(NullInputDevice)
7}
8
9#[derive(Debug, Clone, Copy)]
10struct NullInputDevice;
11
12impl InputDevice for NullInputDevice {
13 fn blocking_read(
14 &mut self,
15 timeout: std::time::Duration,
16 ) -> Result<Option<InternalEvent>, Error> {
17 std::thread::sleep(timeout);
18 Ok(None)
19 }
20}