]> git.sesse.net Git - pkanalytics/blobdiff - main.cpp
Make it possible to seek using the 4th and 5th mouse buttons.
[pkanalytics] / main.cpp
index 65a64e1e9e0196ae683ba41383779ec3d4ea0eee..4caeac38c4d839450dd1db7dd16f28677637943d 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -86,7 +86,6 @@ MainWindow::MainWindow(EventsModel *events, PlayersModel *players,
                position_changed(pos);
        });
 
-
        // It's not really clear whether PgUp should be forwards or backwards,
        // but mpv does at least up = forwards, so that's probably standard.
        QShortcut *pgdown = new QShortcut(QKeySequence(Qt::Key_PageDown), this);
@@ -99,6 +98,8 @@ MainWindow::MainWindow(EventsModel *events, PlayersModel *players,
 
        connect(ui->minus2s, &QPushButton::clicked, [this]() { ui->video->seek(-2000); });
        connect(ui->plus2s, &QPushButton::clicked, [this]() { ui->video->seek(2000); });
+       connect(ui->video, &VideoWidget::mouse_back_clicked, [this]() { ui->video->seek(-2000); });
+       connect(ui->video, &VideoWidget::mouse_forward_clicked, [this]() { ui->video->seek(2000); });
 
        connect(ui->minus1f, &QPushButton::clicked, [this]() { ui->video->seek_frames(-1); });
        connect(ui->plus1f, &QPushButton::clicked, [this]() { ui->video->seek_frames(1); });