What i mean is i only got the last modifier pressed down. As if you didnt do mask |= modifier but as if you did mask = modifier
ok here is a code for you to test add this KeyboardHandler to a viewer class KeyboardHandler : public osgGA::GUIEventHandler { public: virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter&) { switch(ea.getEventType()) { case(osgGA::GUIEventAdapter::KEYDOWN): { std::cout << "DOWN key:" << ea.getKey() << " MASK:" << ea.getModKeyMask() <<std::endl; return false; } case(osgGA::GUIEventAdapter::KEYUP): { std::cout << "UP key:" << ea.getKey() << " MASK:" << ea.getModKeyMask() <<std::endl; return false; } default: return false; } } }; this is an example of COUT DOWN key:97 MASK:4096 UP key:97 MASK:4096 DOWN key:65507 MASK:4160 UP key:65507 MASK:4096 DOWN key:65505 MASK:4097 UP key:65505 MASK:4096 DOWN key:65505 MASK:4097 DOWN key:65507 MASK:4160 <= here is a problem it should be 4161 (ctrl + shift) UP key:65507 MASK:4096 <= here is a problem it should be 4097 (shift still down) UP key:65505 MASK:4096 2007/7/4, Robert Osfield <[EMAIL PROTECTED]>:
OK, here's a bash at my end at reporting the modifier mask, attached is modified osgkeyboard which prints out the various key modifiers. Things appear odd for me under Linux, when left key down on a modified key I get the left modifier key reported - which is corrected, but on key up the right key modifier is reported. Is this what is happening under Windows? Robert. On 7/4/07, SCETBUN benjamin <[EMAIL PROTECTED]> wrote: > > > 2007/7/4, Robert Osfield <[EMAIL PROTECTED]>: > > On 7/4/07, Benny Deluxe <[EMAIL PROTECTED]> wrote: > > > I am on Windows XP SP2 for the moment. Compiling with visual studio and > it s > > > basic compilator. any idea? > > > > If there is a bug then to fix it I really need to be able reproduce it > > at my end, or have a very clear pointer to where things go wrong. > > > > Could you possible modify an example like osgkeyboard such as via a > > custom EventHandler. > > already did what you are proposing. I launched the OSGKEYBOARD example in > debug mode. > I used the whenhit fonction of visual studio to get the value of > ea._modKeyMask in (in your example file) > > virtual bool handle(const osgGA::GUIEventAdapter& > ea,osgGA::GUIActionAdapter&) > { > switch(ea.getEventType()) // I puted the > whenhit Here > { > case(osgGA::GUIEventAdapter::KEYDOWN): > { > _keyboardModel->keyChange(ea.getKey(),1); > return true; > } > case(osgGA::GUIEventAdapter::KEYUP): > { > _keyboardModel->keyChange( ea.getKey(),0); > return true; > } > > default: > return false; > } > } > > > and this is what i have found > when a is pressed down : > ea._modKeyMask = 4096 > when left shift is pressed down : > ea._modKeyMask = 4097 > when left ctrl is pressed down : > ea._modKeyMask = 4160 > then i press left shift while ctrl : > ea._modKeyMask = 4097 and it should be 4096 + 64 (left ctrl) + 1 (left > shift) = 4161 > > Ask me as many test as you want. But you should be able to reproduce it. > _______________________________________________ > 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/
_______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/