FYI, I submitted a slightly changed version of the example to osg-submissions. This should make key handling work with both wxWidgets 2.6 and 2.8

Paul

Steven Powers wrote:

I added SetFocus() to the onMouse handler and it worked like a charm!

Thanks everyone for your help!

-Steve



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Thibault Genessay
Sent: Wednesday, May 14, 2008 10:05 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] wxWidgets onKeyDown Event not called

Hi Steven

On Wed, May 14, 2008 at 3:42 PM, Steven Powers <[EMAIL PROTECTED]> wrote:
Still having the problem...

The problem I am having is that OnKeyDown and OnKeyUp methods are
never
called when I press a key. The mouse handler functions work fine so I
can control the camera with the mouse. They key press events are not
detected within wxWidgets or OSG EventHandlers.

Anyone else have some Ideas???


Have you checked that the proper event binding mechanism is set on the
wxWidgets side ? You might have bound mouse events to your window but
not keyboard events.

You might also investigate focus issues as normally wxWidgets sends
keyboard events to the window that has the focus (OTOH mouse events
are sent to the window under the cursor, hence their correct
behavior). You can try to call SetFocus() from within your mouse event
handler when you detect a left down event so that your window is ready
to capture subsequent key presses.

Hope this helps

Thibault
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to