mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-03-21 11:48:54 -04:00
right-click-enabler: Allow activation of the right click action by keyboard
This allows for example, selecting the audio output device for visually impaired.
This commit is contained in:
parent
51b540cf72
commit
c2652d3ee5
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user