From Michael Polak, double click fixes/additions
This commit is contained in:
@@ -74,6 +74,9 @@ class OSGGA_EXPORT EventQueue : public osg::Referenced
|
||||
|
||||
/** method for adapting mouse button pressed events, placing this event on the back of the event queue.*/
|
||||
void mouseButtonPress(float x, float y, unsigned int button);
|
||||
|
||||
/** method for adapting mouse button pressed events, placing this event on the back of the event queue.*/
|
||||
void mouseDoubleButtonPress(float x, float y, unsigned int button);
|
||||
|
||||
/** method for adapting mouse button release events, placing this event on the back of the event queue.*/
|
||||
void mouseButtonRelease(float x, float y, unsigned int button);
|
||||
|
||||
@@ -179,6 +179,43 @@ void EventQueue::mouseButtonPress(float x, float y, unsigned int button)
|
||||
addEvent(event);
|
||||
}
|
||||
|
||||
void EventQueue::mouseDoubleButtonPress(float x, float y, unsigned int button)
|
||||
{
|
||||
_accumulateEventState->setX(x);
|
||||
_accumulateEventState->setY(y);
|
||||
|
||||
switch(button)
|
||||
{
|
||||
case(1):
|
||||
_accumulateEventState->setButtonMask(GUIEventAdapter::LEFT_MOUSE_BUTTON | _accumulateEventState->getButtonMask());
|
||||
break;
|
||||
case(2):
|
||||
_accumulateEventState->setButtonMask(GUIEventAdapter::MIDDLE_MOUSE_BUTTON | _accumulateEventState->getButtonMask());
|
||||
break;
|
||||
case(3):
|
||||
_accumulateEventState->setButtonMask(GUIEventAdapter::RIGHT_MOUSE_BUTTON | _accumulateEventState->getButtonMask());
|
||||
break;
|
||||
}
|
||||
|
||||
GUIEventAdapter* event = new GUIEventAdapter(*_accumulateEventState);
|
||||
event->setEventType(GUIEventAdapter::DOUBLECLICK);
|
||||
|
||||
switch(button)
|
||||
{
|
||||
case(1):
|
||||
event->setButton(GUIEventAdapter::LEFT_MOUSE_BUTTON);
|
||||
break;
|
||||
case(2):
|
||||
event->setButton(GUIEventAdapter::MIDDLE_MOUSE_BUTTON);
|
||||
break;
|
||||
case(3):
|
||||
event->setButton(GUIEventAdapter::RIGHT_MOUSE_BUTTON);
|
||||
break;
|
||||
}
|
||||
|
||||
addEvent(event);
|
||||
}
|
||||
|
||||
void EventQueue::mouseButtonRelease(float x, float y, unsigned int button)
|
||||
{
|
||||
_accumulateEventState->setX(x);
|
||||
|
||||
Reference in New Issue
Block a user