firing bullet with mouse

hi,
I’d like to know how do I fire a bullet with mouse - left button for example.
In examples I’ve seen sth. like this :


self.accept("mouse1", .....)

but it’s not working. when I use


self.accept("space", self.fire)

everything is OK.

any ideas where is the problem ? thnx

“mouse1” is indeed the name of the event generated when you click on the left mouse button. But the mouse pointer does need to be within the graphics window when you click. I don’t know why “space” would work when “mouse1” does not.

If there’s any doubt as to the events you are generating, you can do this:


messenger.toggleVerbose()

this will set a mode where each message generated is printed to your console; it can be quite noisy. When I do it, and click on the left mouse button, I see this:

:08-19-2005 09:56:40 Messenger(debug): sent event: mouse1 sentArgs: []
:08-19-2005 09:56:40 Messenger(debug): sent event: time-mouse1 sentArgs: [1.3018960000000004]
:08-19-2005 09:56:40 Messenger(debug): sent event: mouse1-up sentArgs: []
:08-19-2005 09:56:40 Messenger(debug): sent event: time-mouse1-up sentArgs: [1.3442370000000003]

David

hmmm… I know that it sounds really strange but suddenly - it’s working ?! of course I tried it many times before I decided to bother people in forum.

:blush: :blush: :blush: :blush:

anyway thanx for you reply.