-from pygame.locals import USEREVENT
-TIMEOUT = USEREVENT + 1
-NOTEON = USEREVENT + 2
-NOTEOFF = USEREVENT + 3
+import pygame
+from sys import modules
+
+events = ['TIMEOUT', 'NOTEON', 'NOTEOFF', 'NOTEEND', 'COLDOWN', 'COLUP', 'COLOVER']
+eventNames = {}
+self = modules[__name__]
+
+for i, name in enumerate(events) :
+ eventType = pygame.USEREVENT+i
+ eventNames[eventType] = name
+ setattr(self, name, eventType)
+
+pygame_events = [
+ 'NOEVENT',
+ 'ACTIVEEVENT',
+ 'KEYDOWN',
+ 'KEYUP',
+ 'MOUSEMOTION',
+ 'MOUSEBUTTONDOWN',
+ 'MOUSEBUTTONUP',
+ 'JOYAXISMOTION',
+ 'JOYBALLMOTION',
+ 'JOYHATMOTION',
+ 'JOYBUTTONDOWN',
+ 'JOYBUTTONUP',
+ 'VIDEORESIZE',
+ 'VIDEOEXPOSE',
+ 'QUIT',
+ 'SYSWMEVENT',
+ 'USEREVENT',
+ 'NUMEVENTS'
+ ]
+
+for name in pygame_events :
+ eventNames[getattr(pygame, name)] = name