Trees | Indices | Help |
---|
|
joy.events defines a few utility functions for handling pygame events in the JoyApp framework. Because joy extends pygame with several new event types, you should use joy.event functions to handle tasks such as printing human readable event descriptions -- the pygame builtins won't know anything about the JoyApp specific event types. New Event Types --------------- TIMEREVENT -- timeslice event timer for Plan execution CKBOTPOSITION -- a CKBot moved SCRATCHUPDATE -- a Scratch variable was updated Main Functions -------------- describeEvt -- describe an event in a string
|
|||
|
|||
|
|
Describe an event stored in a pygame EventType object. Returns a human readable string that consists of all fields in the event object. These are printed in a format that makes it easy to cut and paste them into code that pattern matches events, e.g. >>> evt = pygame.event.Event(pygame.locals.MOUSEMOTION,pos=(176, 140),rel=(0, 1),buttons=(0, 0, 0)) >>> print describeEvt(evt,0) type==MOUSEMOTION pos==(176, 140) rel==(0, 1) buttons==(0, 0, 0) If parseOnly is set, returns a dictionary with the extracted fields: >>> print joy.events.describeEvt(evt,1) {'buttons': (0, 0, 0), 'type': 'MouseMotion', 'pos': (176, 140), 'rel': (0, 1)} |
Wrapper for pygame.Event constructor, which understands the additional event types unique to JoyApp INPUT: type_code -- integer -- the typecode for the event type OUTPUT: Event object, or ValueError object with error details, if failed |
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Thu Jan 4 16:46:17 2018 | http://epydoc.sourceforge.net |