Skip to content

Commit

Permalink
Fix propogating keyReleaseEvent on MainWindow.
Browse files Browse the repository at this point in the history
  • Loading branch information
ddennedy committed Mar 3, 2015
1 parent 5b366e4 commit cc85315
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1037,8 +1037,8 @@ void MainWindow::keyPressEvent(QKeyEvent* event)
m_player->rewind();
break;
case Qt::Key_K:
m_player->pause();
m_isKKeyPressed = true;
m_player->pause();
m_isKKeyPressed = true;
break;
case Qt::Key_L:
if (m_isKKeyPressed)
Expand Down Expand Up @@ -1230,10 +1230,11 @@ void MainWindow::keyPressEvent(QKeyEvent* event)

void MainWindow::keyReleaseEvent(QKeyEvent* event)
{
qDebug() << event->key();
if (event->key() == Qt::Key_K)
m_isKKeyPressed = false;
else
QMainWindow::keyPressEvent(event);
QMainWindow::keyReleaseEvent(event);
}

// Drag-n-drop events
Expand Down

0 comments on commit cc85315

Please sign in to comment.