While working on the next tutorial, I ran into this. The MouseMotionListener callbacks use the old 0, 1, 2... button IDs instead of button masks:
So does the InputReader using unbuffered input:
Code: Select all
if ( mInputDevice->getMouseButton( 0 ) )
But the MouseListener uses button masks for the same function:
Code: Select all
if ( e->getButtonID() & MouseEvent::BUTTON0_MASK )
This is very inconsistant, and it causes a huge problem if you try to do something if both mouse buttons are held down. However, any changes to it now will break source compatibility with anyone using Ogre input.
---
Also, could you consider changing these:
Code: Select all
virtual void mouseClicked(MouseEvent* e) = 0;
virtual void mouseEntered(MouseEvent* e) = 0;
virtual void mouseExited(MouseEvent* e) = 0;
and maybe just all of the MouseListener and MouseMotionListener methods to be not pure-virtual? I end up with a lot of code that simply turns them off. This second suggestion would not break source compatability.
Edit: Alternatively, would you accept a patch to fix this to make everything work with button masks? I'm hesitiant to get started on it since I'm not sure it would be accepted (breaking source compatibility after 1.0.0 and all).