Added Escape to the help list.

Changed the help key from '?' to 'h'
This commit is contained in:
Robert Osfield
2003-03-28 10:04:58 +00:00
parent 190c32c73a
commit 60e16ea044
3 changed files with 11 additions and 3 deletions

View File

@@ -54,6 +54,10 @@ class OSGPRODUCER_EXPORT KeyboardMouseCallback : public Producer::KeyboardMouseC
virtual void specialKeyRelease( Producer::KeyCharacter key);
void setEscapeSetDone(bool esc) { _escapeKeySetsDone = esc; }
bool getEscapeSetDone() const { return _escapeKeySetsDone; }
// local methods and members
typedef std::vector< osg::ref_ptr<EventAdapter> > EventQueue;

View File

@@ -293,6 +293,11 @@ void Viewer::requestWarpPointer(int x,int y)
void Viewer::getUsage(osg::ApplicationUsage& usage) const
{
if (_kbmcb && _kbmcb->getEscapeSetDone())
{
usage.addKeyboardMouseBinding("Escape","Exit the application");
}
for(EventHandlerList::const_iterator itr=_eventHandlerList.begin();
itr!=_eventHandlerList.end();
++itr)

View File

@@ -735,8 +735,7 @@ bool ViewerEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActio
}
case osgGA::GUIEventAdapter::KEY_Help :
case '/' :
case '?' :
case 'h' :
{
setDisplayHelp(!getDisplayHelp());
return true;
@@ -759,7 +758,7 @@ void ViewerEventHandler::accept(osgGA::GUIEventHandlerVisitor& gehv)
void ViewerEventHandler::getUsage(osg::ApplicationUsage& usage) const
{
usage.addKeyboardMouseBinding("f","Toggle fullscreen");
usage.addKeyboardMouseBinding("?","Display help");
usage.addKeyboardMouseBinding("h","Display help");
usage.addKeyboardMouseBinding("o","Write scene graph to file");
usage.addKeyboardMouseBinding("s","Toggle intrumention");
usage.addKeyboardMouseBinding("v","Toggle block and vsync");