Show
Ignore:
Timestamp:
06/20/13 12:05:56 (less than one hour ago)
Author:
robert
Message:

From Juan Manuel Alvarez, "When handling keyboard events on osgQt, if a key is kept pressed, multiple sequences of KEYDOWN -> KEYUP events are fired.

This is because Qt auto repeats keyboard events, so multiple calls are made to GLWidget::keyPressEvent and GLWidget::keyReleaseEvent by Qt, and subsequently translated to OSG events.

The way to solve this is ignoring key released auto repeated events (see http://qt-project.org/doc/qt-4.8/qkeyevent.html#isAutoRepeat), so multiple KEYDOWN events are fired, but only one KEYUP.

I attach a modified osgQt/GraphicsWindowQt.cpp with this change."

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgViewer/GraphicsWindowX11.cpp

    r13041 r13130  
    718718 
    719719    // get any shared GLX contexts 
    720     GraphicsHandleX11* graphicsHandleX11 = dynamic_cast<GraphicsHandleX11*>(_traits->sharedContext); 
     720    GraphicsHandleX11* graphicsHandleX11 = dynamic_cast<GraphicsHandleX11*>(_traits->sharedContext.get()); 
    721721    Context sharedContext = graphicsHandleX11 ? graphicsHandleX11->getContext() : 0; 
    722722