diff --git a/include/osgViewer/api/X11/GraphicsWindowX11 b/include/osgViewer/api/X11/GraphicsWindowX11 index f226300e4..6c3e69555 100644 --- a/include/osgViewer/api/X11/GraphicsWindowX11 +++ b/include/osgViewer/api/X11/GraphicsWindowX11 @@ -166,6 +166,7 @@ class OSGVIEWER_EXPORT GraphicsWindowX11 : public osgViewer::GraphicsWindow void forceKey(int key, double time, bool state); void getModifierMap(char* keymap) const; int getModifierMask() const; + void syncCapsLock(); bool _valid; Display* _display; diff --git a/src/osgViewer/GraphicsWindowX11.cpp b/src/osgViewer/GraphicsWindowX11.cpp index 11bd12c48..46e418874 100644 --- a/src/osgViewer/GraphicsWindowX11.cpp +++ b/src/osgViewer/GraphicsWindowX11.cpp @@ -1018,6 +1018,7 @@ void GraphicsWindowX11::checkEvents() case EnterNotify : osg::notify(osg::INFO)<<"EnterNotify event received"<getCurrentEventState()->getModKeyMask(); + if (_lockMask) + { + mask |= osgGA::GUIEventAdapter::MODKEY_CAPS_LOCK; + } + else + { + mask &= ~osgGA::GUIEventAdapter::MODKEY_CAPS_LOCK; + } + getEventQueue()->getCurrentEventState()->setModKeyMask(mask); +} + // Returns char[32] keymap with bits for every modifier key set. void GraphicsWindowX11::getModifierMap(char* keymap) const {