mousewheel

Hello,

I got a silly problem.
I try to catch mouse wheel event :

self.accept("wheel_up", self.speedUp,[1])
self.accept("wheel_down", self.speedUp,[-1])

But some times, I need to catch wheel and button. But When I click left and maintain down the left button, I don’t catch no more the event of wheel.

Maybe is it possible the the combinaison of the two events…?

I don’t think you’d be able to catch a combination (you can with keyboard presses I think). But I just tested it and while the mouse1 was down wheel_up and wheel_down events still fired for me:

:Messenger(debug): sent event: mouse1 sentArgs = [], taskChain = None
:Messenger(debug): sent event: time-mouse1 sentArgs = [5.2499365189146205], taskChain = None
:Messenger(debug): sent event: mousedev3-mouse1 sentArgs = [], taskChain = None
:Messenger(debug): sent event: wheel_down sentArgs = [], taskChain = None
:Messenger(debug): sent event: wheel_down-up sentArgs = [], taskChain = None
:Messenger(debug): sent event: time-wheel_down sentArgs = [6.180998212707822], taskChain = None
:Messenger(debug): sent event: time-wheel_down-up sentArgs = [6.180998212707822], taskChain = None
:Messenger(debug): sent event: wheel_up sentArgs = [], taskChain = None
:Messenger(debug): sent event: wheel_up-up sentArgs = [], taskChain = None
:Messenger(debug): sent event: time-wheel_up sentArgs = [7.03128721303166], taskChain = None
:Messenger(debug): sent event: time-wheel_up-up sentArgs = [7.03128721303166], taskChain = None
:Messenger(debug): sent event: mouse1-up sentArgs = [], taskChain = None
:Messenger(debug): sent event: time-mouse1-up sentArgs = [7.749677747679059], taskChain = None
:Messenger(debug): sent event: mousedev3-mouse1-up sentArgs = [], taskChain = None

Try putting messenger.toggleVerbose() into your code, and you can see the events fire as you use the mouse.

In this instance, if I wanted to know if the user is using the mouse wheel while mouse1, I’d set a variable on ‘mouse1’ and clear it on ‘mouse1-up’. I’d then check against that variable during the mousewheel event. If that makes sense :slight_smile: