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);
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); });
void VideoWidget::mousePressEvent(QMouseEvent *e)
{
- if (e->button() == Qt::LeftButton) {
+ if (e->button() == Qt::BackButton) {
+ emit mouse_back_clicked();
+ } else if (e->button() == Qt::ForwardButton) {
+ emit mouse_forward_clicked();
+ } else if (e->button() == Qt::LeftButton) {
dragging = true;
last_drag_x = e->position().x();
last_drag_y = e->position().y();
void paintGL() override;
void wheelEvent(QWheelEvent *event) override;
- // For dragging.
+ // For dragging, and for back/forward button presses.
void mousePressEvent(QMouseEvent *e);
void mouseReleaseEvent(QMouseEvent *e);
void mouseMoveEvent(QMouseEvent *e);
signals:
void position_changed(uint64_t pos);
+ void mouse_back_clicked();
+ void mouse_forward_clicked();
private:
// Should really have been persistent and a PBO, but this is OK for now.