Nick,

 

I tried the change you proposed, thanks.  It is not sufficient because
keySymbol gets set to 0 in adaptKey.  Therefore a key press of 0 is inserted
into the event queue.

 

Something along these lines would work… but I don’t know if we want to
generate extra/indistinguishable keydowns in this manner.  I would advocate
what JS proposed instead.

 

For example the user hits ` then a.  I believe a fix along the lines of what
Nick proposed would generate 3 keydowns, one for ` one for a and one for à.
A fix along the lines of what JS proposed would generate 2 keydowns.  One
for ` with a translated code of 0.  One for a with a translated code of à.
This way the translated and untranslated codes are distinguishable.  

 

JS- However I am wary of the issue where the WM_KEYDOWN is received and
WM_CHAR is not (as in my case).  In this case how do you handle what you are
proposing?

 

Another option would be to make separate keydown and char events (like
windows has).  It sounds like this would be a lot of work.  Also I’m not
sure how other OSs handle this…

 

Thanks

-Brad

 

From: [email protected]
[mailto:[email protected]] On Behalf Of Trajce
(Nick) Nikolov
Sent: Monday, September 20, 2010 10:03 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Keypress broken since rev 11749

 

Hi Brad,

 

did you tried my change with adding the new extra line in
GraphicsWindowWin32.cpp ? I think it will fix it. This way the key that was
being translated to WM_CHAR will be passed as WM_KEYDOWN as well


-Nick



On Mon, Sep 20, 2010 at 5:51 PM, Jean-Sébastien Guay
<[email protected]> wrote:

Hi Brad,

 

Robert- One issue with including both the translated and untranslated
keys in the event is that there is not a one to one mapping.  In windows
sometimes 3 key presses will translate to one WM_CHAR (translated key)
message and they don’t even need to be pressed at the same time (in the
case of dead keys).  Whereas I believe there is a one-to-one between
WM_KEYDOWN and key presses…

 

I don't think that's a problem, in that case there will be 3 keydown events:

- the first two would have an untranslated key code but the translated code
would be invalid (say -1 so the app can recognize it and just do nothing if
it only wants translated codes)

- and the third event would have both a translated and untranslated codes
(both would be valid).

Thus apps that want raw keypresses could get them, and apps (or
osgWidget::Input) that need translated keys could just ignore keypresses
where the translated code is invalid.



J-S
-- 
______________________________________________________
Jean-Sebastien Guay    [email protected]
                              http://www.cm-labs.com/
                       http://whitestar02.webhop.org/
_______________________________________________

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