Skip to main content

InputSource

Trait InputSource 

Source
pub trait InputSource {
    // Required method
    fn poll(&mut self, out: &mut Vec<InputEvent>);
}
Expand description

A source of platform input.

poll is non-blocking and drains whatever is queued. On Linux the same object will also expose its file descriptors so an event loop can epoll on input and vblank together rather than spinning — that arrives with denise-evdev in M2.

Required Methods§

Source

fn poll(&mut self, out: &mut Vec<InputEvent>)

Appends every pending event to out, leaving existing contents alone.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§