Function sdl2::event::peek_events [] [src]

pub fn peek_events<B>(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, peek_events};

// Read up to 1024 events
let events: Vec<Event> = peek_events(1024);

// Print each one
for event in events {
    println!("{:?}", event);
}