From Martins Innus, "Here is a fix to add requestWarpPointer for OS X. It seems to work for me, I just took what osgProducer had. These are updated files to 2.7.3"
This commit is contained in:
@@ -92,6 +92,9 @@ class GraphicsWindowCarbon : public osgViewer::GraphicsWindow
|
||||
/** Set Window decoration.*/
|
||||
virtual bool setWindowDecorationImplementation(bool flag);
|
||||
|
||||
// Override from GUIActionAdapter
|
||||
virtual void requestWarpPointer( float x, float y);
|
||||
|
||||
/** Get focus.*/
|
||||
virtual void grabFocus();
|
||||
|
||||
|
||||
@@ -1259,6 +1259,24 @@ void GraphicsWindowCarbon::setWindowName (const std::string& name)
|
||||
}
|
||||
}
|
||||
|
||||
void GraphicsWindowCarbon::requestWarpPointer(float x,float y)
|
||||
{
|
||||
|
||||
OSXCarbonWindowingSystemInterface* wsi = dynamic_cast<OSXCarbonWindowingSystemInterface*>(osg::GraphicsContext::getWindowingSystemInterface());
|
||||
if (wsi == NULL) {
|
||||
osg::notify(osg::WARN) << "GraphicsWindowCarbon::useCursor :: could not get OSXCarbonWindowingSystemInterface" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
CGDirectDisplayID displayId = wsi->getDisplayID((*_traits));
|
||||
|
||||
CGPoint point;
|
||||
point.x = x;
|
||||
point.y = y;
|
||||
CGDisplayMoveCursorToPoint(displayId, point);
|
||||
|
||||
getEventQueue()->mouseWarped(x,y);
|
||||
}
|
||||
|
||||
|
||||
void GraphicsWindowCarbon::transformMouseXY(float& x, float& y)
|
||||
|
||||
Reference in New Issue
Block a user