#[tokio::main] async fn main() { let mut rx = witas::EventReceiver::new(); let _window = witas::Window::builder() .title("witas set_position_size") .inner_size(witas::LogicalSize::new(640, 480)) .set_receiver(&rx) .await .unwrap(); loop { let (event, window) = rx.recv().await; match event { witas::Event::KeyInput(k) => { let window = window.as_window().unwrap(); match k.as_vkey_state() { (witas::VirtualKey::P, witas::KeyState::Pressed) => { window.set_position(witas::ScreenPosition::new(10, 10)); } (witas::VirtualKey::S, witas::KeyState::Pressed) => { window.set_inner_size(witas::LogicalSize::new(800, 600)); } _ => {} } } witas::Event::Closed => break, _ => {} } } }