[osg-users] X11 keyboard bug (+ ugly fix)

Ulrich Hertlein u.hertlein at sandbox.de
Tue Feb 5 15:33:37 PST 2008


Quoting Melchior FRANZ <melchior.franz at gmail.com>:
> X11 does, of course, tell you which modifiers are active. But only
> which modifier level (shift), not which modifier key (shift_l, shift_r),
> so you'd still release keys that were never pressed before. (I'm not
> sure if that's really a problem, but it might be.) One would have to
> keep track of every single key to avoid it.  :-/

The way I read it EventQueue actually tracks which modifier keys are pressed so
it's possible to put some code in EventQueue::keyRelease so that it doesn't
generate an event when a modifier is released that wasn't pressed before.

(I also noticed that EQ doesn't track or respond to Super_* and Hyper_* keys.)

/ulrich

PS: What SDL/X11 does is to update its internal keyboard state every time the
windows gets input focus or the mouse enters the window (actually on
KeymapNotify which is generated after every EnterNotify and FocusIn.)  AFAIK
osgGA doesn't support any of those yet.


More information about the osg-users mailing list