Skip to content

Commit

Permalink
Merge pull request #2369 from tyrylu/right_click_using_keyboard
Browse files Browse the repository at this point in the history
right-click-enabler: Allow activation of the right click action by keyboard
  • Loading branch information
f4exb authored Jan 2, 2025
2 parents 51b540c + c2652d3 commit 3f7e119
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 3f7e119

Please sign in to comment.