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:
@@ -87,6 +87,24 @@ void EventQueue::windowResize(float Xmin, float Ymin, float Xmax, float Ymax)
|
||||
addEvent(event);
|
||||
}
|
||||
|
||||
void EventQueue::penPressure(float pressure)
|
||||
{
|
||||
GUIEventAdapter* event = new GUIEventAdapter(*_accumulateEventState);
|
||||
event->setEventType(GUIEventAdapter::PEN_PRESSURE);
|
||||
event->setPenPressure(pressure);
|
||||
|
||||
addEvent(event);
|
||||
}
|
||||
|
||||
void EventQueue::penProximity(GUIEventAdapter::TabletPointerType pt, bool isEntering)
|
||||
{
|
||||
GUIEventAdapter* event = new GUIEventAdapter(*_accumulateEventState);
|
||||
event->setEventType( (isEntering) ? GUIEventAdapter::PEN_PROXIMITY_ENTER : GUIEventAdapter::PEN_PROXIMITY_LEAVE);
|
||||
event->setTabletPointerType(pt);
|
||||
|
||||
addEvent(event);
|
||||
}
|
||||
|
||||
void EventQueue::mouseScroll(GUIEventAdapter::ScrollingMotion sm)
|
||||
{
|
||||
GUIEventAdapter* event = new GUIEventAdapter(*_accumulateEventState);
|
||||
@@ -96,6 +114,16 @@ void EventQueue::mouseScroll(GUIEventAdapter::ScrollingMotion sm)
|
||||
addEvent(event);
|
||||
}
|
||||
|
||||
void EventQueue::mouseScroll2D(float x, float y)
|
||||
{
|
||||
GUIEventAdapter* event = new GUIEventAdapter(*_accumulateEventState);
|
||||
event->setEventType(GUIEventAdapter::SCROLL);
|
||||
event->setScrollingMotionDelta(x,y);
|
||||
|
||||
addEvent(event);
|
||||
}
|
||||
|
||||
|
||||
void EventQueue::mouseWarp(float x, float y)
|
||||
{
|
||||
_accumulateEventState->setX(x);
|
||||
|
||||
Reference in New Issue
Block a user