HI Vivien,

The OSG already passes back translated keys, or at least that's the
current intention.  Having some keyboard events pass by translated,
and other events pass back untranslated key is a recipe for confusion.
 It would also complicate user code substantially as event handlers
would need to carry state of their own to track the sequence of
keydown/repeat/keyup events.

As I said earlier, I believe the right way is to add a field into the
GUIEventHandler for translated and untranslated keys, key up, key
down, and any key repeat events we might want to generate would set
both fields and then users are free to use whichever they prefer.

This wouldn't seem to solve the Windows specific problem with bugs in
key translation code that you've spoken of though.  Perhaps we should
just live with them but provide the untranslated key types as well for
cases where problems might arise, or just have a bash at writing our
own less buggy key translation code.

Robert.

On Fri, Sep 17, 2010 at 12:49 PM, Vivien Delage <[email protected]> wrote:
> Hi Robert,
>
> I would agree with revert the code for now if it causes trouble.
> I think handling it on the GUIEventAdapter would indeed solve the problem.
>
> Here is a possible solution:
>
> - add a new EventType in GUIEventAdapter. It could be called "KEYENTERED". 
> This event would return the translated key. This event could be called 
> multiple times for repetition when the user keeps the key pressed.
> - add a "translatedkey" filed with accessors in GUIEventAdapter
> - add a method void translatedkeyEntered(int translatedkey, double time); in 
> the EventQueue
>
>
> This way we could have two sets of events:
> - KEYDOWN and KEYUP would be left unchanged and would be giving the 
> untranslated key. This is usefull for application like osgViewer. This way it 
> would not break backward compatibility.
>
> - KEYENTERED would be giving the translated key, usefull for guis.
>
> Vivien
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=31758#31758
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to