MCPcopy Create free account
hub / github.com/IENT/YUView / handleKeyPress

Method handleKeyPress

YUViewLib/src/ui/Mainwindow.cpp:571–626  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

569}
570
571bool MainWindow::handleKeyPress(QKeyEvent *event, bool keyFromSeparateView)
572{
573 int key = event->key();
574 bool controlOnly = (event->modifiers() == Qt::ControlModifier);
575
576 if (key == Qt::Key_Escape)
577 {
578 if (isFullScreen())
579 {
580
581 ui.displaySplitView->toggleFullScreenAction();
582 return true;
583 }
584 }
585 else if (key == Qt::Key_F && controlOnly)
586 {
587 ui.displaySplitView->toggleFullScreenAction();
588 return true;
589 }
590 else if (key == Qt::Key_Space)
591 {
592 ui.playbackController->on_playPauseButton_clicked();
593 return true;
594 }
595 else if (key == Qt::Key_Right)
596 {
597 ui.playbackController->nextFrame();
598 return true;
599 }
600 else if (key == Qt::Key_Left)
601 {
602 ui.playbackController->previousFrame();
603 return true;
604 }
605 else if (key == Qt::Key_Down)
606 {
607 ui.playlistTreeWidget->selectNextItem();
608 return true;
609 }
610 else if (key == Qt::Key_Up)
611 {
612 ui.playlistTreeWidget->selectPreviousItem();
613 return true;
614 }
615 else if (stateHandler.handleKeyPress(event, keyFromSeparateView))
616 {
617 return true;
618 }
619 else if (!keyFromSeparateView)
620 {
621 // See if the split view widget handles this key press. If not, return false.
622 return ui.displaySplitView->handleKeyPress(event);
623 }
624
625 return false;
626}
627
628bool MainWindow::eventFilter(QObject *watched, QEvent *event)

Callers 1

keyPressEventMethod · 0.45

Calls 6

nextFrameMethod · 0.80
previousFrameMethod · 0.80
selectNextItemMethod · 0.80
selectPreviousItemMethod · 0.80

Tested by

no test coverage detected