def clearEvents(eventType=None):
 if ((not havePygame) or (not display.get_init())):
  defDisplay = pyglet.window.get_platform().get_default_display()
  for win in defDisplay.get_windows():
   win.dispatch_events()
  if (eventType == 'mouse'):
   return
  global _keyBuffer
  _keyBuffer = []
 elif (eventType == 'mouse'):
  junk = evt.get([locals.MOUSEMOTION, locals.MOUSEBUTTONUP, locals.MOUSEBUTTONDOWN])
 elif (eventType == 'keyboard'):
  junk = evt.get([locals.KEYDOWN, locals.KEYUP])
 elif (eventType == 'joystick'):
  junk = evt.get([locals.JOYAXISMOTION, locals.JOYBALLMOTION, locals.JOYHATMOTION, locals.JOYBUTTONUP, locals.JOYBUTTONDOWN])
 else:
  junk = evt.get()

def clearEvents ( eventType = None ) : if ( ( not havePygame ) or ( not display . get_init ( ) ) ) : defDisplay = pyglet . window . get_platform ( ) . get_default_display ( ) for win in defDisplay . get_windows ( ) : win . dispatch_events ( ) if ( eventType == 'mouse' ) : return global _keyBuffer _keyBuffer = [ ] elif ( eventType == 'mouse' ) : junk = evt . get ( [ locals . MOUSEMOTION , locals . MOUSEBUTTONUP , locals . MOUSEBUTTONDOWN ] ) elif ( eventType == 'keyboard' ) : junk = evt . get ( [ locals . KEYDOWN , locals . KEYUP ] ) elif ( eventType == 'joystick' ) : junk = evt . get ( [ locals . JOYAXISMOTION , locals . JOYBALLMOTION , locals . JOYHATMOTION , locals . JOYBUTTONUP , locals . JOYBUTTONDOWN ] ) else : junk = evt . get ( )
clears all events currently in the event buffer .