Skip to content

Commit

Permalink
> Fixes Shift-Alt shortcuts on Linux
Browse files Browse the repository at this point in the history
+ Changed Ctrl-Alt-(Down/Up) on Ctrl-(Down/Up)
  • Loading branch information
trueromanus committed Dec 10, 2023
1 parent 2305584 commit 1c2ecc3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ViewModels/backendviewmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,13 @@ void BackendViewModel::fillMappings()
m_shortcutCommandMapping.insert("control-plus", m_saveToFileCommand);
m_shortcutCommandMapping.insert("control-8", m_generateImageToFileCommand);
m_shortcutCommandMapping.insert("alt-8", m_generateImageToClipboardCommand);
#ifdef Q_OS_LINUX
m_shortcutCommandMapping.insert("control-down", m_nextFindedResultCommand);
m_shortcutCommandMapping.insert("control-up", m_previousFindedResultCommand);
#else
m_shortcutCommandMapping.insert("control-alt-down", m_nextFindedResultCommand);
m_shortcutCommandMapping.insert("control-alt-up", m_previousFindedResultCommand);
#endif
}

void BackendViewModel::fillCommands()
Expand Down
3 changes: 3 additions & 0 deletions src/ViewModels/globaleventhandlermodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ bool GlobalEventHandlerModel::eventFilter(QObject *watched, QEvent *event)
// fix issue with keyboard layout
if (virtualCode >= 65 && virtualCode <= 90) button = virtualCode;
if (m_remappingVirtualCodes.contains(virtualCode)) button = virtualCode;
#ifdef Q_OS_LINUX
if (virtualCode == 65511) button = Qt::Key_Alt; //fixed Shift-Alt combination
#endif

if (!m_keyMapping.contains(button)) return QObject::eventFilter(watched, event);

Expand Down

0 comments on commit 1c2ecc3

Please sign in to comment.