diff --git a/ui/widgets/fields/input_field.cpp b/ui/widgets/fields/input_field.cpp index ebfc977..ae643c0 100644 --- a/ui/widgets/fields/input_field.cpp +++ b/ui/widgets/fields/input_field.cpp @@ -31,6 +31,10 @@ #include #include +#ifdef Q_OS_WIN +#include +#endif // Q_OS_WIN + namespace Ui { namespace { @@ -2910,16 +2914,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. +#ifdef Q_OS_WIN return e->modifiers().testFlag(Qt::ControlModifier) && e->modifiers().testFlag(Qt::ShiftModifier) - && (e->nativeVirtualKey() == 190); // VK_OEM_PERIOD + && (e->nativeVirtualKey() == VK_OEM_PERIOD); #else // Q_OS_WIN return false; -#endif // Q_OS_WIN +#endif // !Q_OS_WIN }; if (e == QKeySequence::Bold) { toggleSelectionMarkdown(kTagBold);