[vos-d] WXGLCanvas keyboard input problem...

res resqu at gmx.ch
Sun Mar 11 17:27:52 EDT 2007


On 11.03.2007 21:22, Peter Amstutz wrote:
> Bingo!  I just reviewed a couple of old checkouts of Crystal Space I 
> have, and it looks like some one "cleaned up" (i.e. broke) the plugin.
> 
> I orginally had a function:
> 
>  void csGLCanvas::OnEnterWindow( wxMouseEvent& WXUNUSED(event) )
>  {
>   SetFocus();
>  }
> 
> Which fixes precisely the keyboard focus problem by giving it "focus 
> on enter" behavior.
> 
> Someone changed it to:
> 
>  void csGLCanvas::OnEnterWindow( wxMouseEvent& WXUNUSED(event) )
>  {
>   csRef<iEventNameRegistry> enr = CS_QUERY_REGISTRY (g2d->object_reg, 
> iEventNameRegistry);
>   g2d->EventOutlet->Broadcast(csevFocusGained(enr));
> }
> 
> The problem is, this tells Crystal Space has focus, but doesn't change 
> the *system* focus, which was the whole purpose of calling SetFocus().  
> Someone misread the purpose of the method and... broke it.
> 
> So, try re-adding SetFocus() to the csGLCanvas::OnEnterWindow() method 
> (in CS/plugins/video/canvas/wxgl/GLWXDriver2D.cpp).

I would say neither is right. "Mouse enter" and "gain focus" are two
distinct events, and a mouse enter generally does not cause a focus
change. Example: focus has an edit field, you want to type something.
For some reason, the mouse gets moved over the WXGL view... would you
want the WXGL view to take the focus? Probably not.

-f.r.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://www.interreality.org/pipermail/vos-d/attachments/20070311/3d9681a6/attachment.pgp 


More information about the vos-d mailing list