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 [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/ _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
-- Drew Whitehouse ANU Supercomputer Facility Vizlab _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
