Wiki Page Content

Differences between revisions 4 and 5
Revision 4 as of 2010-07-17 00:18:06
Size: 2914
Editor: SheenaSmith
Comment: update content, formatting
Revision 5 as of 2010-07-28 19:46:21
Size: 3191
Editor: SheenaSmith
Comment: update content - changeset 4624
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
||<tablewidth="100%" style="color: #FF0000;" :> DRAFT|| ||<tablewidth="100%"style="color: rgb(255, 0, 0); text-align: center;">DRAFT ||
Line 15: Line 16:
                   Uint32 mask)                    Uint32 minType,
Uint32 maxType)
Line 19: Line 21:
||'''events'''||^a pointer to the ID of the event queue to query^||
||'''numevents'''||^the number of events to work with^; see [[#Remarks|Remarks]] for details||
||'''action'''||^how to handle the events in the queue^; see [[#action|Remarks]] for details||
||'''mask'''||*a bit-wise OR of SDL_EVENTMASK(event_type), for all event types you are interested in*; see [[#mask|Remarks]] and [[SDL_EventMask]] for details ???||
||'''events''' ||^a pointer to the ID of the event queue to query^ ||
||'''numevents''' ||^the number of events to work with^; see [[#Remarks|Remarks]] for details ||
||'''action''' ||^how to handle the events in the queue^; see [[#action|Remarks]] for details ||
||'''minType''' ||^the minimum number of events of a specified type^ ??? ||
||'''max
Type''' ||^the maximum number of events of a specified type^ ??? ||
Line 33: Line 36:
<<Anchor(action)>>
'''action''' may be any of the following (from enum SDL_eventaction):
||SDL_ADDEVENT||up to '''numevents''' events will be added to the back of the event queue||
||SDL_PEEKEVENT||up to '''numevents''' events at the front of the event queue, matching '''mask''', will be returned and will not be removed from the queue||
||SDL_GETEVENT||up to '''numevents''' events at the front of the event queue, matching '''mask''', will be returned and will be removed from the queue||
<<Color2(green,NOTE: Recent changes have removed the '''mask''' param but the following information has not been adjusted to reflect this change yet.)>> <<Anchor(action)>> '''action''' may be any of the following <<Color2(green,(from enum SDL_eventaction which has no page))>>:
||SDL_ADDEVENT ||up to '''numevents''' events will be added to the back of the event queue ||
||SDL_PEEKEVENT ||up to '''numevents''' events at the front of the event queue, matching '''mask''', will be returned and will not be removed from the queue ||
||SDL_GETEVENT ||up to '''numevents''' events at the front of the event queue, matching '''mask''', will be returned and will be removed from the queue ||
Line 46: Line 48:
If '''action''' is SDL_GETEVENT, up to '''numevents''' events at the front of the event queue, matching '''mask''', will be returned and will be removed from the queue.  If '''action''' is SDL_GETEVENT, up to '''numevents''' events at the front of the event queue, matching '''mask''', will be returned and will be removed from the queue.
Line 49: Line 51:
 *SDL_EVENTMASK (SDL_KEYUP)
 *(SDL_EVENTMASK (SDL_MOUSEBUTTONDOWN) | SDL_EVENTMASK (SDL_MOUSEBUTTONUP))
 *SDL_ALLEVENTS
 *SDL_KEYUPMASK
 *SDL_ALLEVENTS ^ SDL_QUITMASK

* SDL_EVENTMASK (SDL_KEYUP)
 * (SDL_EVENTMASK (SDL_MOUSEBUTTONDOWN) | SDL_EVENTMASK (SDL_MOUSEBUTTONUP))
 * SDL_ALLEVENTS
 * SDL_KEYUPMASK
 * SDL_ALLEVENTS ^ SDL_QUITMASK
Line 58: Line 62:
<<Color2(green,Is this true in 1.3?)>>
You may have to call [[SDL_PumpEvents]]() before calling this function. Otherwise, the events may not be ready to be filtered when you call [[SDL_PeepEvents]]().
<<Color2(green,Is the following true in 1.3?)>> You may have to call [[SDL_PumpEvents]]() before calling this function. Otherwise, the events may not be ready to be filtered when you call [[SDL_PeepEvents]]().
Line 62: Line 65:
 .[[SDL_PollEvent]] *???
 .[[SDL_PumpEvents]] *???
 .[[SDL_PushEvent]] *???
 . [[SDL_PollEvent]] *???
 . [[SDL_PumpEvents]] *???
 . [[SDL_PushEvent]] *???
Line 67: Line 70:
[[CategoryAPI]], [[CategoryEvents]] [[CategoryAPI]], CategoryEvents

DRAFT

SDL_PeepEvents

Use this function to check the event queue for messages and optionally return them.

Syntax

int SDL_PeepEvents(SDL_Event*      events,
                   int             numevents,
                   SDL_eventaction action,
                   Uint32          minType,
                   Uint32          maxType)

Function Parameters

events

a pointer to the ID of the event queue to query

numevents

the number of events to work with; see Remarks for details

action

how to handle the events in the queue; see Remarks for details

minType

the minimum number of events of a specified type ???

maxType

the maximum number of events of a specified type ???

Return Value

Returns the number of events actually stored, or -1 if there was an error; call SDL_GetError() for more information.

Code Examples

You can add your code example here

Remarks

green

action may be any of the following green

:

SDL_ADDEVENT

up to numevents events will be added to the back of the event queue

SDL_PEEKEVENT

up to numevents events at the front of the event queue, matching mask, will be returned and will not be removed from the queue

SDL_GETEVENT

up to numevents events at the front of the event queue, matching mask, will be returned and will be removed from the queue

green

If action is SDL_ADDEVENT, up to numevents events will be added to the back of the event queue.

If action is SDL_PEEKEVENT, up to numevents events at the front of the event queue, matching mask, will be returned and will not be removed from the queue.

If action is SDL_GETEVENT, up to numevents events at the front of the event queue, matching mask, will be returned and will be removed from the queue.

*Examples of mask:

  • SDL_EVENTMASK (SDL_KEYUP)
  • (SDL_EVENTMASK (SDL_MOUSEBUTTONDOWN) | SDL_EVENTMASK (SDL_MOUSEBUTTONUP))
  • SDL_ALLEVENTS
  • SDL_KEYUPMASK
  • SDL_ALLEVENTS ^ SDL_QUITMASK

*

{i} This function is thread-safe.

green

You may have to call SDL_PumpEvents() before calling this function. Otherwise, the events may not be ready to be filtered when you call SDL_PeepEvents().


CategoryAPI, CategoryEvents

None: SDL_PeepEvents (last edited 2015-04-26 19:50:04 by PhilippWiesemann)

Feedback
Please include your contact information if you'd like to receive a reply.
Submit