2 from sys
import modules
14 self
= modules
[__name__
]
16 for i
, name
in enumerate(events
) :
17 eventType
= pygame
.USEREVENT
+ 1 + i
18 if eventType
>= pygame
.NUMEVENTS
:
19 eventType
= eventType
+ 1
20 eventNames
[eventType
] = name
21 setattr(self
, name
, eventType
)
44 for name
in pygame_events
:
45 eventNames
[getattr(pygame
, name
)] = name
47 eventCodes
= dict([v
, k
] for k
, v
in eventNames
.items())