Duncan Webb wrote:
> I wonder if it is possible to incorporate the pygame event loop into
> notifier or may be another way to get mouse events.

Sure, here's an example:

    def step_event(self):
        for e in pygame.event.get():
            if e.type is QUIT:
                sys.exit(0)
            if e.type is KEYDOWN:
                if e.key == K_ESCAPE or e.key == K_q:
                    sys.exit(0)
                elif e.key == K_f:
                    pygame.display.toggle_fullscreen()

            self._screen.gui.event(e)
        return True


    kaa.notifier.Timer(self.step_event).start(1.0/10)


This empties the pygme event queue 10 times per second, which seems to
be enough for me.  For Freevo, inside that for loop you could access
some dict / mapping to translate specific pygame events to Freevo events
and fire them off.

I hope that helps.  It just so happens that I've been writing some
kaa+pygame code.

-Rob

Attachment: signature.asc
Description: OpenPGP digital signature

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Freevo-devel mailing list
Freevo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to