Hi Gianni, I've reviewed your changes and as I'm not Qt expert aren't 100% sure of the need/consequences yet so I'll have to do some further reading and testing. From looking at the changes it has the feel of change that might fix you problem but will break other usage cases.
I believe what you are attempting to do is just handle the unmodified key type and make the keyboard handling only work this way. This approach breaks user code that witshes to use the modified key. The way we've tackled this in osgViewer's native windowing support was to introduce an UnmodifiedKey, and where supported the key event is set up with both the UnmodifiedKey and the Key values. Might this be appropriate solution here? You'd need to create the GUIEventAdapter object and pass this rather than rely upon the EventQueue convinience method but this is pretty straight forward. Robert. On 24 October 2012 10:59, Gianni Ambrosio <[email protected]> wrote: > Hi, > it seems there is a bug in GLWidget::keyPressEvent(QKeyEvent* event). > I guess the problem is here: > > > Code: > int remapKey(QKeyEvent* event) > { > KeyMap::iterator itr = mKeyMap.find(event->key()); > if (itr == mKeyMap.end()) > { > return int(*(event->text().toAscii().data())); > } > else > return itr->second; > } > > > > "return int(*(event->text().toAscii().data()));" is not correct for a > QKeyEvent with modifiers (like "CTRL+F") in fact event->text() method returns > the char pressed only for keys without modifiers. Otherwise the 'txt' > variable contains something else. The only way to get the key pressed in > combination with a modifier is through the event->key() method. For that > reason I suggest to improve the mKeyMap with other keys as attached. > > Regards, > Gianni > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=50749#50749 > > > > > Attachments: > http://forum.openscenegraph.org//files/graphicswindowqt_576.cpp > > > _______________________________________________ > osg-submissions mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
