if (_buttons.find(button) == _buttons.end()) {
return false;
}
-
+
+ if (!anyBindingEnabled(_bindingsDown)) {
+ return false;
+ }
+
fireBindingList(_bindingsDown);
_repeatTime = -_repeatInterval; // anti-bobble: delay start of repeat
return true;
virtual bool hover( const osg::Vec2d& windowPos,
const Info& )
{
- if (_hover.empty()) {
+ if (!anyBindingEnabled(_hover)) {
return false;
}
}
}
+bool anyBindingEnabled(const SGBindingList& aBindings)
+{
+ if (aBindings.empty()) {
+ return false;
+ }
+
+ BOOST_FOREACH(SGBinding_ptr b, aBindings) {
+ if (!b->test()) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
*/
void clearBindingList(const SGBindingList& aBindings);
+/**
+ * check if at least one binding in the list is enabled. Returns false if bindings
+ * list is empty, or all bindings are conditinally disabled.
+ */
+bool anyBindingEnabled(const SGBindingList& bindings);
+
#endif