.\" This manpage content is licensed under Creative Commons .\" Attribution 4.0 International (CC BY 4.0) .\" https://creativecommons.org/licenses/by/4.0/ .\" This manpage was generated from SDL's wiki page for SDL_PeepEvents: .\" https://wiki.libsdl.org/SDL_PeepEvents .\" Generated with SDL/build-scripts/wikiheaders.pl .\" revision SDL-3.1.0 .\" Please report issues in this manpage's content at: .\" https://github.com/libsdl-org/sdlwiki/issues/new .\" Please report issues in the generation of this manpage from the wiki at: .\" https://github.com/libsdl-org/SDL/issues/new?title=Misgenerated%20manpage%20for%20SDL_PeepEvents .\" SDL can be found at https://libsdl.org/ .de URL \$2 \(laURL: \$1 \(ra\$3 .. .if \n[.g] .mso www.tmac .TH SDL_PeepEvents 3 "SDL 3.1.0" "SDL" "SDL3 FUNCTIONS" .SH NAME SDL_PeepEvents \- Check the event queue for messages and optionally return them\[char46] .SH SYNOPSIS .nf .B #include \(dqSDL3/SDL.h\(dq .PP .BI "int SDL_PeepEvents(SDL_Event *events, int numevents, SDL_eventaction action, Uint32 minType, Uint32 maxType); .fi .SH DESCRIPTION .BR action may be any of the following: \(bu .BR .BR SDL_ADDEVENT : up to .BR numevents events will be added to the back of the event queue\[char46] \(bu .BR .BR SDL_PEEKEVENT : .BR numevents events at the front of the event queue, within the specified minimum and maximum type, will be returned to the caller and will _not_ be removed from the queue\[char46] \(bu .BR .BR SDL_GETEVENT : up to .BR numevents events at the front of the event queue, within the specified minimum and maximum type, will be returned to the caller and will be removed from the queue\[char46] You may have to call .BR SDL_PumpEvents () before calling this function\[char46] Otherwise, the events may not be ready to be filtered when you call .BR SDL_PeepEvents ()\[char46] This function is thread-safe\[char46] .SH FUNCTION PARAMETERS .TP .I events destination buffer for the retrieved events .TP .I numevents if action is .BR SDL_ADDEVENT , the number of events to add back to the event queue; if action is .BR SDL_PEEKEVENT or .BR SDL_GETEVENT , the maximum number of events to retrieve .TP .I action action to take; see [[#action|Remarks]] for details .TP .I minType minimum value of the event type to be considered; .BR SDL_EVENT_FIRST is a safe choice .TP .I maxType maximum value of the event type to be considered; .BR SDL_EVENT_LAST is a safe choice .SH RETURN VALUE Returns the number of events actually stored or a negative error code on failure; call .BR SDL_GetError () for more information\[char46] .SH AVAILABILITY This function is available since SDL 3\[char46]0\[char46]0\[char46] .SH SEE ALSO .BR SDL_PollEvent (3), .BR SDL_PumpEvents (3), .BR SDL_PushEvent (3)