From Stephan Huber,

"attached you'll find some modifications to Producer, osgGA and
osgProducer to enable Mac OS X support for

+ scrollwheels,
+ mightymouse-srollballs
+ new tracking-pads with scroll feature
+ tablet-support (pressure, proximity and pointertype) (Wacom only tested)

I think there was a bug in the windows-implementation of scroll-wheel
support (wrong order of ScrollingMotion-enum, casting problem) which is
fixed now.

The scrollwheel-code is a bit klunky across platforms, some devices on
OS X can report an absolute delta in pixel-coordinates not only the
direction, so for now there is scrollingMotion (which describes the
direction) and scrolldeltax and scrolldeltay. I decided to leave the
scrollingmotion-stuff to not break old code relying on this."
This commit is contained in:
Robert Osfield
2006-07-04 14:18:44 +00:00
parent b0d738384f
commit e7d9e91525
6 changed files with 113 additions and 7 deletions

View File

@@ -25,12 +25,33 @@ void KeyboardMouseCallback::mouseScroll( Producer::KeyboardMouseCallback::Scroll
switch(sm)
{
case(Producer::KeyboardMouseCallback::ScrollNone): break;
case(Producer::KeyboardMouseCallback::ScrollLeft): _eventQueue->mouseScroll(osgGA::GUIEventAdapter::SCROLL_LEFT); break;
case(Producer::KeyboardMouseCallback::ScrollRight): _eventQueue->mouseScroll(osgGA::GUIEventAdapter::SCROLL_RIGHT); break;
case(Producer::KeyboardMouseCallback::ScrollUp): _eventQueue->mouseScroll(osgGA::GUIEventAdapter::SCROLL_UP); break;
case(Producer::KeyboardMouseCallback::ScrollDown): _eventQueue->mouseScroll(osgGA::GUIEventAdapter::SCROLL_DOWN); break;
case(Producer::KeyboardMouseCallback::Scroll2D): _eventQueue->mouseScroll(osgGA::GUIEventAdapter::SCROLL_2D); break;
}
}
}
void KeyboardMouseCallback::mouseScroll2D( float x, float y )
{
updateWindowSize();
if (_eventQueue.valid()) _eventQueue->mouseScroll2D(x,y);
}
void KeyboardMouseCallback::penPressure( float pressure )
{
updateWindowSize();
if (_eventQueue.valid()) _eventQueue->penPressure(pressure);
}
void KeyboardMouseCallback::penProximity(TabletPointerType pt, bool isEntering)
{
updateWindowSize();
if (_eventQueue.valid()) _eventQueue->penProximity((osgGA::GUIEventAdapter::TabletPointerType)pt, isEntering);
}
void KeyboardMouseCallback::buttonPress( float mx, float my, unsigned int mbutton )
{
updateWindowSize();