#[tokio::main] async fn main() { let mut rx = witas::EventReceiver::new(); let mut raw_input_rx = witas::RawInputEventRecevier::new(); let _window = witas::Window::builder() .title("witas raw_input") .inner_size(witas::LogicalSize::new(640, 480)) .set_receiver(&rx) .set_raw_input_receiver(&raw_input_rx) .await .unwrap(); let th = tokio::spawn(async move { let device_list = witas::raw_input::get_device_list().unwrap(); for device in &device_list { println!("{}", device.name()); println!("{:?}", device.get_info()); } loop { let (event, _) = raw_input_rx.recv().await; match event { witas::raw_input::RawInputEvent::Input(input) => { println!("{:?}", input); } witas::raw_input::RawInputEvent::DeviceChange(dc) => { println!("{:?}", dc); } witas::raw_input::RawInputEvent::Closed => break, } } }); loop { let (event, _) = rx.recv().await; println!("{:?}", event); if let witas::Event::Closed = event { break; } } th.await.unwrap(); }