mouse scroll affects mouse movement ?

This is weird.
If I scroll it up/down while it stayed still (no movement at all, I’m sure), it jumps to lower right direction, around 50 pixels from it’s position before.
After that, I moved it slowly, and it moved from the original position, just like there wasn’t that jump, but that jump was considered as movement (always to lower right). It’s really obvious when I use it for my FPS style mouse-controlled camera orientation. And I’m sure it’s not my code failure, it happened too when running the tutorial samples.

Nothing’s wrong when I used it within other 3D apps.
Is it my mouse problem ?

This? It? Uh, you’ve completly lost me. Be more careful with your pronouns and try again.

Alright, here is the clearer thing chronologically :


  • my mouse stayed still
  • I scrolled the wheel up or down
  • the cursor jumped about 50 pixel to lower right, and it throwed mouse move event

I moved my mouse a little bit, and the cursor moved just like it didn’t jump before (it moved from the last point before the jump)

That’s all.

[EDIT] :
I also have checked this behavior on different system, different graphic card, different mouse of course, and it persists.
FYI, this weird behavior is pretty obvious when running the mouse-move based tutorials :

  • collision detection (labyrinth)
  • picking (chessboard)
  • joint manipulation (walking Eve)

Finally I’m pretty sure that this behavior is a flaw in the mouse handler.
If you doubt it, try to open any 3D scene, and pan, rotate, or zoom the camera. Hold down the LMB, MMB, or RMB, make sure your mouse is not moving at all, then scroll the wheel up or down. It will generate mouse move event, which is always to lower right direction !!!
And after that, if you actually move your mouse, it will move from the last point before the jump.

I have experienced the same problem under windows using 1.2.3, unfortunately i have not found any solution yet.

You’re absolutely right: this is a bug deep in the mouse-handling code in Panda 1.2.3. My apologies. I’ve just checked in a fix; this should make it into the next release of Panda.


Of course there is possible workaround. You can use a dictionary to store the events. So, each time before your code responds for the real mouse-move events, firstly you must check if there is NOT wheel_up/down event. Basically that will work, I haven’t tried it myself though.

I don’t know if this bug has been fixed in v1.3.0, I haven’t downloaded it.
The mouse jump distance is actually as far as the window-origin, so setting your window-origin in config file to 0,0 fixes this, or just go fullscreen.