Function winput::message_loop::start[][src]

pub fn start() -> Result<EventReceiver, MessageLoopError>

Starts the message loop on a new thread.

Returns

This function returns an error if the message loop is already active: only one message loop can be started at any given time. Be carfull if another library is also using the message loop.

You can check if the message loop is currently active by calling is_active.

Example

use winput::message_loop;

let receiver = message_loop::start().unwrap();

loop {
    println!("{:?}", receiver.next_event());
}