Module winput::message_loop [−][src]
Expand description
The message_loop
module provides a way to retreive keyboard and mouse
input messages directly from the system.
Internally, a message-only window is created to receive the messages.
Examples
ⓘ
use winput::{Vk, Action}; use winput::message_loop; let receiver = message_loop::start().unwrap(); loop { match receiver.next_event() { message_loop::Event::Keyboard { vk, action: Action::Press, .. } => { if vk == Vk::Escape { break; } else { println!("{:?} was pressed!", vk); } }, _ => (), } }
Structs
The result of the start
function. This structure receives the messages
received by the message loop.