Home
Products
Community
Manuals
Contact
Login or Signup

BlitzPlus Docs -> GUI - Category -> Events -> PeekEvent

PeekEvent()

Parameters:

None.

Description:

PeekEvent checks if any events are waiting to be processed and if so, returns its id.

If no event is available, PeekEvent returns 0. Unlike WaitEvent if no events are available, control is returned immediately to your program.

Note that PeekEvent event does not update the other event functions such as EventID or EventData. PeekEvent does NOT clear the event queue, so you must call FlushEvents after dealing with the event in order to process any further events.

See also: FlushEvents, WaitEvent.

Example:

; create a basic window to play with
win=CreateWindow("PeekEvent Example",100,100,200,200,0,49)
button=CreateButton("Hit me! I do nothing!",10,10,180,20,win)
Repeat
	id=PeekEvent() ; are there any events waiting to be processed?
	If id<>0 Then
		If id=$803 Then Exit 	; exit on window close	
		FlushEvents()			; clear out any remaining events
	End If
	VWait 
Forever
End ; bye! 

Comments

None.

BlitzPlus Manual Forum

Blitz3D Equivalent Command