[osg-submissions] osgViewer/X11: consider capslock on FocusOut/FocusIn key handling

Melchior FRANZ melchior.franz at gmail.com
Wed Mar 12 08:18:50 PDT 2008


This bugfix probably got lost. It has been submitted more than
two weeks ago. Almost all patches that were submitted later
habe been committed already. Here again, this time as diff:



Index: include/osgViewer/api/X11/GraphicsWindowX11
===================================================================
--- include/osgViewer/api/X11/GraphicsWindowX11 (revision 7924)
+++ include/osgViewer/api/X11/GraphicsWindowX11 (working copy)
@@ -48 +48,2 @@
-            _lastEventType(0)
+            _lastEventType(0),
+            _lockMask(0)
@@ -185,0 +187 @@
+        int             _lockMask;
Index: src/osgViewer/GraphicsWindowX11.cpp
===================================================================
--- src/osgViewer/GraphicsWindowX11.cpp (revision 7924)
+++ src/osgViewer/GraphicsWindowX11.cpp (working copy)
@@ -714 +714 @@
-                                     KeymapStateMask | FocusChangeMask );
+                                     KeymapStateMask | FocusChangeMask | EnterWindowMask );
@@ -1017,0 +1018,5 @@
+            case EnterNotify :
+                osg::notify(osg::INFO)<<"EnterNotify event received"<<std::endl;
+                _lockMask = ev.xcrossing.state & LockMask;
+                break;
+
@@ -1172,0 +1178 @@
+                _lockMask = ev.xkey.state & LockMask;
@@ -1202 +1208,2 @@
-#endif
+#endif
+                _lockMask = ev.xkey.state & LockMask;
@@ -1315 +1322 @@
-    event.state = getModifierMask();
+    event.state = getModifierMask() | _lockMask;
@@ -1319 +1326 @@
-    int keySymbol = 0;
+    int keySymbol;


More information about the osg-submissions mailing list