[osg-submissions] osgViewer/X11: avoid excess key event on focus-in
Melchior FRANZ
melchior.franz at gmail.com
Fri May 2 06:18:10 PDT 2008
In KDE I switch desktops with Super-Tab, and occasionally I
get an excess Tab key report when switching back to an OSG
application (usually FlightGear :-). Although KDE has consumed
the Tab, it's sometimes still in the XKeymapEvent's key_vector,
and followed by a Tab KeyRelease event.
Avoid this artifact by
- asking for a "fresh" keymap (via XQueryKeymap()), rather than
using the unreliable(?) XKeymapEvent's key_vector, and by
- flushing all key events on focus-in (to avoid the KeyRelease)
After Super-press, Tab-press, Super-release, Tab-release (note
the wrong release order!) I still get an extra Tab event. But
this is not surprising and not exactly wrong either. Also it's
hard to avoid, as we can't see what happened to the keyboard
before we regained focus.
Files changed:
src/osgViewer/GraphicsWindowX11.cpp
include/osgViewer/api/X11/GraphicsWindowX11
m.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: osgviewer-x11.diff
Type: text/x-diff
Size: 2720 bytes
Desc: not available
Url : http://lists.openscenegraph.org/pipermail/osg-submissions-openscenegraph.org/attachments/20080502/4fd919be/attachment.diff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: osgviewer-x11.tar.bz2
Type: application/x-tbz
Size: 12786 bytes
Desc: not available
Url : http://lists.openscenegraph.org/pipermail/osg-submissions-openscenegraph.org/attachments/20080502/4fd919be/attachment.bin
More information about the osg-submissions
mailing list