From e4004118db486ef00d2df8189a5d573cc466e757 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 20 May 2014 08:34:32 +0000 Subject: [PATCH] Added check against whether an event has been handled or not before actioning escape/quit. --- src/osgViewer/CompositeViewer.cpp | 4 ++++ src/osgViewer/Viewer.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/osgViewer/CompositeViewer.cpp b/src/osgViewer/CompositeViewer.cpp index 5bb9eff22..85045e898 100644 --- a/src/osgViewer/CompositeViewer.cpp +++ b/src/osgViewer/CompositeViewer.cpp @@ -1120,6 +1120,10 @@ void CompositeViewer::eventTraversal() { osgGA::GUIEventAdapter* event = (*itr)->asGUIEventAdapter(); if (!event) continue; + + // ignore event if it's already been handled. + if (event->getHandled()) continue; + switch(event->getEventType()) { case(osgGA::GUIEventAdapter::KEYUP): diff --git a/src/osgViewer/Viewer.cpp b/src/osgViewer/Viewer.cpp index 3ab9f63b0..613e21b9f 100644 --- a/src/osgViewer/Viewer.cpp +++ b/src/osgViewer/Viewer.cpp @@ -989,6 +989,10 @@ void Viewer::eventTraversal() { osgGA::GUIEventAdapter* event = (*itr)->asGUIEventAdapter(); if (!event) continue; + + // ignore event if it's already been handled. + if (event->getHandled()) continue; + switch(event->getEventType()) { case(osgGA::GUIEventAdapter::KEYUP):