diff --git a/src/input.rs b/src/input.rs index 4dd33ce..b160b6b 100644 --- a/src/input.rs +++ b/src/input.rs @@ -1,7 +1,5 @@ extern crate evdev; -use std::os::unix::io::{AsRawFd, RawFd}; -use std::{io, mem, ptr}; use evdev::Device; pub fn select_device() -> Device { diff --git a/src/main.rs b/src/main.rs index 8db251a..7afdc5e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,8 +6,12 @@ mod select; fn main() -> Result<(), Box> { let mut device = input::select_device(); device.grab()?; - if select::is_readable(&mut device) { - println!("event!") + for _ in 0..5 { + if select::is_readable(&mut device) { + for ev in device.fetch_events().unwrap() { + println!("event: {:?}", ev); + } + } } device.ungrab()?; Ok(())