]> git.mxchange.org Git - flightgear.git/commitdiff
Pass key-mod state into pick-callbacks.
authorJames Turner <zakalawe@mac.com>
Thu, 7 Mar 2013 18:41:38 +0000 (18:41 +0000)
committerJames Turner <zakalawe@mac.com>
Thu, 7 Mar 2013 18:41:38 +0000 (18:41 +0000)
Allow pick-callbacks to get the current mod-state at all times. (Required for matching SG change)

src/Input/FGMouseInput.cxx

index 926173c53db8ac3df6c56bd140669a1ed81cbefa..c66a4b24f5c5382eef4b6de2f297214989ad350c 100644 (file)
@@ -55,7 +55,7 @@ const int MAX_MOUSE_BUTTONS = 8;
  */
 class ActivePickCallbacks : public std::map<int, std::list<SGSharedPtr<SGPickCallback> > > {
 public:
-    void update( double dt );
+    void update( double dt, unsigned int keyModState );
     void init( int button, const osgGA::GUIEventAdapter* ea );
 };
 
@@ -84,13 +84,13 @@ void ActivePickCallbacks::init( int button, const osgGA::GUIEventAdapter* ea )
   }
 }
 
-void ActivePickCallbacks::update( double dt )
+void ActivePickCallbacks::update( double dt, unsigned int keyModState )
 {
   // handle repeatable mouse press events
   for( iterator mi = begin(); mi != end(); ++mi ) {
     std::list<SGSharedPtr<SGPickCallback> >::iterator li;
     for (li = mi->second.begin(); li != mi->second.end(); ++li) {
-      (*li)->update(dt);
+      (*li)->update(dt, keyModState);
     }
   }
 }
@@ -384,7 +384,7 @@ void FGMouseInput::update ( double dt )
       }
   }
     
-  d->activePickCallbacks.update( dt );
+  d->activePickCallbacks.update( dt, fgGetKeyModifiers() );
 }
 
 mouse::mouse ()
@@ -447,7 +447,7 @@ void FGMouseInput::doMouseClick (int b, int updown, int x, int y, bool mainWindo
     // Execute the mouse up event in any case, may be we should
     // stop processing here?
     while (!d->activePickCallbacks[b].empty()) {
-      d->activePickCallbacks[b].front()->buttonReleased();
+      d->activePickCallbacks[b].front()->buttonReleased(ea->getModKeyMask());
       d->activePickCallbacks[b].pop_front();
     }
   }