Hi Alberto,
it seems a matter of capitalization: M=77 ASCII while m=109ASCII Maybe a
toupper or a tolower can help.
First, I am not crazy, I did *not* have the shift key pressed, nor caps
lock on :-)
I just investigated a bit more. When I press 'm', the key Wx reports
(int key = event.getKeyCode()) is 109 in the OnChar(event) handler, but
it's 77 in the OnKeyUp(event) handler. So my guess is that in OnChar we
get the actual character while in OnKeyUp it considers the m key the
same whether shift is pressed or not.
It makes sense, considering that the StatsHandler checks keys in the
osgGA::GUIEventAdapter::KEYDOWN event, but the ThreadingHandler checks
them in the osgGA::GUIEventAdapter::KEYUP handler. So the StatsHandler
gets the right key code while the ThreadingHandler doesn't.
I changed the code to get the keycode from this:
int key = event.GetKeyCode();
to this:
int key = event.GetKeyCode();
if ((event.GetModifiers() & wxMOD_SHIFT) != 0)
key = toupper(key);
else
key = tolower(key);
(not sure if there's a better way to do this, I'm not a WX expert...)
And that works. Unfortunately, changing threading modes at run time
leads to a crash (which I don't get in osgviewer) so it's not that
useful unless I have the time to debug the crash too... Not now though.
So, do I submit the changed file that fixes the OnKeyUp() issue (might
be hackish) but crashes when switching threading models anyway?
J-S
--
______________________________________________________
Jean-Sebastien Guay [EMAIL PROTECTED]
http://www.cm-labs.com/
http://whitestar02.webhop.org/
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org