From 1b34fed5007c334461343faa6407b4f09d97ffd9 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 19 May 2014 09:30:36 +0000 Subject: [PATCH] Added handling of up/down key to ComboBox --- src/osgUI/ComboBox.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/osgUI/ComboBox.cpp b/src/osgUI/ComboBox.cpp index fa99ce8c0..47264cb6e 100644 --- a/src/osgUI/ComboBox.cpp +++ b/src/osgUI/ComboBox.cpp @@ -41,17 +41,29 @@ bool ComboBox::handleImplementation(osgGA::EventVisitor* ev, osgGA::Event* event switch(ea->getEventType()) { case(osgGA::GUIEventAdapter::SCROLL): - OSG_NOTICE<<"Scroll "<getScrollingMotion()==osgGA::GUIEventAdapter::SCROLL_DOWN) { - OSG_NOTICE<<"Scroll Down`"<getScrollingMotion()==osgGA::GUIEventAdapter::SCROLL_UP) { - OSG_NOTICE<<"Scroll Up`"<0) setCurrentItem(getCurrentItem()-1); + return true; } + break; + case(osgGA::GUIEventAdapter::KEYDOWN): + if (ea->getKey()==osgGA::GUIEventAdapter::KEY_Down) + { + if (getCurrentItem()getKey()==osgGA::GUIEventAdapter::KEY_Up) + { + if (getCurrentItem()>0) setCurrentItem(getCurrentItem()-1); + return true; + } + break; case(osgGA::GUIEventAdapter::PUSH): OSG_NOTICE<<"Button pressed "<