Show
Ignore:
Timestamp:
07/03/09 21:16:53 (5 years ago)
Author:
robert
Message:

Added Dragger::s/getActivationModKeyMask(..) and Dragger::s/getActivationKeyEvent(...) methods to make it possible to have draggers that only respond when you press a specified modified key or standard key.

Changed the optional dragger in osgvolume to require the shift key to be pressed for the dragger to become active.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgmanipulator/osgmanipulator.cpp

    r10439 r10454  
    9999    osgManipulator::Dragger* dragger = createDragger(name); 
    100100 
    101     dragger->setHandleEvents(true); 
    102101 
    103102    osg::Group* root = new osg::Group; 
     
    110109 
    111110    dragger->addTransformUpdating(selection); 
     111 
     112    // we want the dragger to handle it's own events automatically 
     113    dragger->setHandleEvents(true); 
     114 
     115    // if we don't set an activation key or mod mask then any mouse click on 
     116    // the dragger will activate it, however if do define either of ActivationModKeyMask or 
     117    // and ActivationKeyEvent then you'll have to press either than mod key or the specified key to 
     118    // be able to activate the dragger when you mouse click on it.  Please note the follow allows 
     119    // activation if either the ctrl key or the 'a' key is pressed and held down. 
     120    dragger->setActivationModKeyMask(osgGA::GUIEventAdapter::MODKEY_CTRL); 
     121    dragger->setActivationKeyEvent('a'); 
    112122 
    113123    return root;