Hi Andre, I just downloaded your latest update via cvs and the keyboard support is now working. Thanks for your excellent work !
-Drew On 2/6/07, André Garneau <[EMAIL PROTECTED]> wrote:
Hi Drew, The value "16" is VK_SHIFT, the virtual key code for the SHIFT key. Since Windows does not differentiate between the LEFT and RIGHT variants for the virtual key code, it always send this value in the key press event. There is an extended key indicator in the message that is set to allow differentiating between a LEFT and RIGHT key press, but for the SHIFT key it is not set (but is set properly for the ALT and CTRL keys modifiers). Bottom line is that the SHIFT key seems to be very special to Windows and it behaves accordingly... ;-) André -----Message d'origine----- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Drew Whitehouse Envoyé : February 5, 2007 2:44 PM À : osg users Objet : Re: [osg-users] Re: GraphicsWindowWin32 is here! :-) I guess the thing I'm not understanding is why neither KEY_Shift_L or KEY_Shift_R has the value 16, where is 16 coming from ? -Drew On 2/6/07, André Garneau <[EMAIL PROTECTED]> wrote: > Hi Drew, > > Yes, this is the expected behavior for the current implementation. > > In short, for SHIFT, CTRL and ALT keys, there is not a separate key > value returned for left and right key press variants; this information > is encoded in the modifiers flags returned as part of the key press > information. So in your example below, pressing the left or right > SHIFT key will always return the same key value (16). However if you > also look at the modifier flags value, you will see that it's set to > indicate if the left or right key variant was pressed. > > For key release events, the same key value is returned, but this time > without any modifier flag set (so you cannot, with the current > implementation, distinguish between a left SHIFT key release and a > RIGHT shift key release). > > As mentioned in the original email, the real issue (a nuisance really) > is the fact that Windows does not readily provide the information on > which key variant (base or extended) a release event applies to. To > fix this will probably require keeping previous key-state information > in the keyboard handler code; keyboard events hooking will likely be > required to achieve this in a multi-window setup. > > André > > -----Message d'origine----- > De : [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] De la part de Drew > Whitehouse Envoyé : February 5, 2007 12:09 AM À : osg users Objet : > Re: [osg-users] Re: GraphicsWindowWin32 is here! :-) > > Hi Andre, > > I'm not quite sure what you are saying here. > > If I put this in a GUIEventHandler > > switch (ea.getEventType()) > { > // ......etc .... > > case(osgGA::GUIEventAdapter::KEYDOWN): > { > std::cout << "down "<< ea.getKey() > << " shift l = " << osgGA::GUIEventAdapter::KEY_Shift_L > << " shift r = " << osgGA::GUIEventAdapter::KEY_Shift_R > <<std::endl; > > I see > > down 16 shift l = 65505 shift r = 65506 > > for both left and right shift keys, and similar for the "up" event. Is > this what you'd expect ? > > -Drew > > > -- > Drew Whitehouse > ANU Supercomputer Facility Vizlab > _______________________________________________ > osg-users mailing list > osg-users@openscenegraph.net > http://openscenegraph.net/mailman/listinfo/osg-users > http://www.openscenegraph.org/ > > > > _______________________________________________ > osg-users mailing list > osg-users@openscenegraph.net > http://openscenegraph.net/mailman/listinfo/osg-users > http://www.openscenegraph.org/ > > -- Drew Whitehouse ANU Supercomputer Facility Vizlab _______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/ _______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
-- Drew Whitehouse ANU Supercomputer Facility Vizlab _______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/