Hi,
I asked on #clutter, but I may miss the response so here's the post.

I am using a captured-event function and within that I want to see what buttons/keys are being used. For some reason the event.modifier_state is not the same as the one passed to a connected event.

Any ideas? Is this expected or a bug?

\d

Here's sample code:

import clutter

"""
QUESTION:
Why does the modifier_state mask not appear for captured-event?
"""

class Test(clutter.Rectangle):
        def __init__(self):
                clutter.Actor.__init__(self)
                self.set_color( clutter.color_from_string("Green"))
                self.set_size(50,50)
                self.set_reactive(True)

                ## Runs first -- has no modifier_state
                self.connect('captured-event', self.do_button_release_event)
                ## Runs next -- modifier_state is there.
                self.connect('button-release-event', 
self.do_button_release_event)

        def do_button_release_event( self, obj, evt ):
                if hasattr(evt,'button'):
                        print evt.modifier_state
                return False

stage = clutter.Stage()
stage.set_size(640, 480)
stage.set_color(clutter.color_from_string('Black'))
stage.connect('destroy', clutter.main_quit)

test=Test()
stage.add(test)
test.show()

stage.show()
clutter.main()
--
Fonty Python and Things! -- http://otherwise.relics.co.za/wiki/Software
--
To unsubscribe send a mail to [email protected]

Reply via email to