Struct sdl2::EventSubsystem
[−]
[src]
pub struct EventSubsystem { // some fields omitted }
Methods
impl EventSubsystem
[src]
fn flush_event(&self, event_type: EventType)
Removes all events in the event queue that match the specified event type.
fn flush_events(&self, min_type: u32, max_type: u32)
Removes all events in the event queue that match the specified type range.
fn peek_events<B>(&self, max_amount: u32) -> B where B: FromIterator<Event>
Reads the events at the front of the event queue, until the maximum amount of events is read.
The events will not be removed from the queue.
Example
use sdl2::event::Event; let sdl_context = sdl2::init().unwrap(); let event_subsystem = sdl_context.event().unwrap(); // Read up to 1024 events let events: Vec<Event> = event_subsystem.peek_events(1024); // Print each one for event in events { println!("{:?}", event); }
fn push_event(&self, event: Event) -> SdlResult<()>
Pushes an event to the event queue.