OpenSceneGraph/include/osgViewer/api/X11
Robert Osfield a3a5af18b0 From Franz Melchior, "When switching virtual desktops or minimizing a window, keys
remain in pressed state after revealing, even if they are no
longer pressed on the keyboard. This can have bad effects,
especially if the stuck keys are modifier keys. One has to
press and release the stuck keys again to reset the wrong state.

The fix keeps track of all key presses and releases. On FocusOut
and UnmapNotify it releases all keys that are in pressed state,
and on KeymapNotify (following a FocusIn), it sets the currently
pressed keys again. To avoid confusion in the OSG-using application
normal keys are always reported released /before/ and pressed
/after/ modifier keys.

As current key states are returned as char[32] keymap by
XQueryKeymap and XKeymapEvent, this format is also used to
recognize modifier keys and for maintaining the current
internal key state. Functions to set/clear/query bits in
such a keymap are added.

The patch was extensively tested with osgkeyboard and
FlightGear under KDE and fvwm2. It was not tested on a
Xinerama setup or with multiple windows, but as _eventDisplay
is used throughout, there should be no problems. The patch also
makes the following changes:

- removes old and obsolete handling of modifier keys in ::adaptKey().
 This wasn't only unused, but also wrong (and for that reason commented
 out in revision 7066). The modifier states are actually handled
 in ./src/osgGA/EventQueue.cpp (EventQueue::keyPress/keyRelease).
- fixes some spelling"
2008-02-25 16:50:28 +00:00
..
GraphicsWindowX11 From Franz Melchior, "When switching virtual desktops or minimizing a window, keys 2008-02-25 16:50:28 +00:00
PixelBufferX11 From Mathias Froehlich, "I have extended the X11 pbuffer code to use either the complete set of glx 1.3 2008-02-22 18:38:30 +00:00