X-Git-Url: https://svn.cri.ensmp.fr/git/minwii.git/blobdiff_plain/a08d887d02d2ba5f61f3c7b0eeb8dae1ba4deddf..46e3b6be9bc0e13866d44cca212b8ef94899c64d:/src/app/widgets/playingscreen.py diff --git a/src/app/widgets/playingscreen.py b/src/app/widgets/playingscreen.py index 955a3ab..055ed71 100755 --- a/src/app/widgets/playingscreen.py +++ b/src/app/widgets/playingscreen.py @@ -23,9 +23,9 @@ ON_SATURATION = 1 ON_COLUMN_OVERSIZING = 1.5 -def rename_method(newName) : +def event_handler(eventType) : def doRename(m) : - m.__name__ = newName + m.__name__ = 'eventHandler%s' % eventType return m return doRename @@ -113,7 +113,7 @@ class _PlayingScreenBase(pygame.sprite.OrderedUpdates) : handler = getattr(self, 'eventHandler%s' % event.type, lambda e:None) handler(event) - @rename_method('eventHandler%s' % pygame.KEYDOWN) + @event_handler(pygame.KEYDOWN) def handleKeyDown(self, event) : if event.key == pygame.K_q: self._running = False @@ -121,6 +121,9 @@ class _PlayingScreenBase(pygame.sprite.OrderedUpdates) : if uni.isdigit() and int(uni) <=8 : self.highlightColumn(int(uni)) + + @event_handler(pygame.MOUSEMOTION) + def handleMouseMotion(self, event) :