mouse is moving or not?

PueloGames

17-03-2008 11:01:49

hi again,

how to know if the mouse are moving or not?
i have this:
mSheet->addEventHandler(QuickGUI::Widget::EVENT_MOUSE_MOVE,&Pool::mouseDragPowerLine,this);
when the mouse move it's works fine but i don't know how to do someting if the mouse aren't moving...

kungfoomasta

17-03-2008 16:55:46

Currently there is no functionality to tell you if the mouse is idle, but that's a really good suggestion! Something like EVENT_MOUSE_IDLE. Its not implemented now. You could try altering your code and making use of EVENT_DRAGGED and EVENT_DROPPED events, assuming its acceptable to left click and drag to drag the power line.

PueloGames

17-03-2008 17:57:39

EVENT_MOUSE_IDLE will be good however EVENT_DRAGGED and EVENT_DROPPED it's fine, i'm trying with this now.

PueloGames

24-03-2008 12:32:51

Another question about addEventHandler:
i have this:
mSheet->addEventHandler(QuickGUI::Widget::EVENT_MOUSE_BUTTON_DOWN,&Pool::mouseYRayCasting,this);
but i use the two buttons of the mouse. how to set this event to the left mouse button?

Thanks!

kungfoomasta

24-03-2008 17:21:07

Inside the event handler you will need to cast the EventArgs into MouseEventArgs, and see what button was pressed.

const MouseEventArgs mea = dynamic_cast<const MouseEventArgs&>(EventArgs);

if(mea.buttonID == MB_LEFT)
{
...
}


This code hasn't been tested, I wrote it off the top of my head.

PueloGames

25-03-2008 10:45:45

thank you so much kungfoomasta!! :)