[osg-submissions] osgViewer/X11: make sure the NumLock state is picked up at FocusIn

Melchior FRANZ melchior.franz at gmail.com
Wed Mar 19 10:29:54 PDT 2008


osgViewer toggled the NumLock state correctly when pressing the NumLock
key, but it didn't pick up the initial state. So, if NumLock was on for
the OS at startup (LED on), it was still off for OSG. And the first
keypress turned the LED off, and NumLock on for OSG. The attached fix
picks up the state on every FocusIn, just like it was done in the last
commits for CapsLock. The difference is, that the NumLock mask isn't
standardized (e.g. 0x10 for Linux, and 0x80 for AIX), so we have to do
a reverse lookup (::rescanModifierMapping()).

Note that I could not reproduce the problem on my system, but someone
else confirmed it twice on his, and the patch fixed it for him. 

Changed files:
  ./include/osgViewer/api/X11/GraphicsWindowX11
  ./src/osgViewer/GraphicsWindowX11.cpp

m.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x11numlock.diff
Type: text/x-diff
Size: 4998 bytes
Desc: not available
Url : http://lists.openscenegraph.org/pipermail/osg-submissions-openscenegraph.org/attachments/20080319/bad2e3a3/attachment-0002.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x11numlock.tar.gz
Type: application/x-tgz
Size: 13393 bytes
Desc: not available
Url : http://lists.openscenegraph.org/pipermail/osg-submissions-openscenegraph.org/attachments/20080319/bad2e3a3/attachment-0003.bin 


More information about the osg-submissions mailing list