Commit 1e450324 authored by Patrick Oesterling's avatar Patrick Oesterling

[CHANGE] change WQtGLWidget to ignore auto-repeated key events

parent e61caac6
...@@ -245,7 +245,12 @@ int WQtGLWidget::translateButton( QMouseEvent* event ) ...@@ -245,7 +245,12 @@ int WQtGLWidget::translateButton( QMouseEvent* event )
void WQtGLWidget::keyPressEvent( QKeyEvent* event ) void WQtGLWidget::keyPressEvent( QKeyEvent* event )
{ {
if( event->text() != "" ) // we ignore auto-repeated keys independant of the window manager settings
if( event->isAutoRepeat() )
{
return;
}
if( event->text() != "" )
{ {
m_Viewer->keyEvent( WGEViewer::KEYPRESS, *event->text().toAscii().data() ); m_Viewer->keyEvent( WGEViewer::KEYPRESS, *event->text().toAscii().data() );
} }
...@@ -267,6 +272,11 @@ void WQtGLWidget::keyPressEvent( QKeyEvent* event ) ...@@ -267,6 +272,11 @@ void WQtGLWidget::keyPressEvent( QKeyEvent* event )
void WQtGLWidget::keyReleaseEvent( QKeyEvent* event ) void WQtGLWidget::keyReleaseEvent( QKeyEvent* event )
{ {
// we ignore auto-repeated keys independant of the window manager settings
if( event->isAutoRepeat() )
{
return;
}
switch( event->key() ) switch( event->key() )
{ {
case Qt::Key_Period: case Qt::Key_Period:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment