Skip to content

Commit

Permalink
right-click-enabler: Allow activation of the right click action by ke…
Browse files Browse the repository at this point in the history
…yboard

This allows for example, selecting the audio output device for visually
impaired.
  • Loading branch information
tyrylu committed Dec 28, 2024
1 parent 51b540c commit c2652d3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions sdrgui/gui/crightclickenabler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@ bool CRightClickEnabler::eventFilter(QObject *obj, QEvent *event)
}
}
}
else if (event->type() == QEvent::KeyPress)
{
auto keyEvent = (QKeyEvent*) event;

if ((keyEvent->key() == Qt::Key_Menu && keyEvent->modifiers() == 0) || (keyEvent->modifiers() & Qt::ShiftModifier && keyEvent->key() == Qt::Key_F10))
{
emit rightClick(QCursor::pos());
keyEvent->setAccepted(true);
return true;
}
}
else if (event->type() == QEvent::ContextMenu)
{
// Filter ContextMenu events, so we don't get popup menus as well
Expand Down

0 comments on commit c2652d3

Please sign in to comment.