Use Ctrl+Shift+Dot workaround on Windows only.
This commit is contained in:
parent
0bee95570e
commit
85b25a109d
1 changed files with 5 additions and 1 deletions
|
|
@ -2910,12 +2910,16 @@ bool InputField::handleMarkdownKey(QKeyEvent *e) {
|
|||
return sequence.matches(events) == QKeySequence::ExactMatch;
|
||||
};
|
||||
const auto matchesCtrlShiftDot = [&] {
|
||||
#ifdef Q_OS_WIN
|
||||
// We can't match ctrl+shift+. with QKeySequence because
|
||||
// shift+. gives us '>' and ctrl+shift+> is not the same.
|
||||
// So we check by nativeVirtualKey instead.
|
||||
return e->modifiers().testFlag(Qt::ControlModifier)
|
||||
&& e->modifiers().testFlag(Qt::ShiftModifier)
|
||||
&& (e->nativeVirtualKey() == 190);
|
||||
&& (e->nativeVirtualKey() == 190); // VK_OEM_PERIOD
|
||||
#else // Q_OS_WIN
|
||||
return false;
|
||||
#endif // Q_OS_WIN
|
||||
};
|
||||
if (e == QKeySequence::Bold) {
|
||||
toggleSelectionMarkdown(kTagBold);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue