From db99a4cb90b029a0b8e59138196bc1ea5fea0f70 Mon Sep 17 00:00:00 2001 From: frohlich Date: Sun, 7 Jan 2007 08:34:03 +0000 Subject: [PATCH] Modified Files: animation.cxx: Add a button argument to that animation. The default is to accept any mouse button. --- simgear/scene/model/animation.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/simgear/scene/model/animation.cxx b/simgear/scene/model/animation.cxx index 861c2690..395c6a31 100644 --- a/simgear/scene/model/animation.cxx +++ b/simgear/scene/model/animation.cxx @@ -2092,6 +2092,7 @@ class SGPickAnimation::PickCallback : public SGPickCallback { public: PickCallback(const SGPropertyNode* configNode, SGPropertyNode* modelRoot) : + _button(configNode->getIntValue("button", -1)), _repeatable(configNode->getBoolValue("repeatable", false)), _repeatInterval(configNode->getDoubleValue("interval-sec", 0.1)) { @@ -2112,6 +2113,8 @@ public: } virtual bool buttonPressed(int button, const Info&) { + if (0 <= _button && button != _button) + return false; SGBindingList::const_iterator i; for (i = _bindingsDown.begin(); i != _bindingsDown.end(); ++i) (*i)->fire(); @@ -2140,6 +2143,7 @@ public: private: SGBindingList _bindingsDown; SGBindingList _bindingsUp; + int _button; bool _repeatable; double _repeatInterval; double _repeatTime; -- 2.39.5