diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index 185b5d9681..f57d4314b9 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -156,6 +156,16 @@ using RecognitionCacheMap = base::flat_map; return cache.get(); } +[[nodiscard]] int LayoutIndependentKey(not_null e) { + if constexpr (Platform::IsWindows()) { + const auto native = int(e->nativeVirtualKey()); + if (native >= Qt::Key_A && native <= Qt::Key_Z) { + return native; + } + } + return e->key(); +} + [[nodiscard]] bool InstantViewMediaItemMatches( const HistoryMessageMediaForInstantView::Item &item, PhotoData *photo, @@ -7292,7 +7302,7 @@ void OverlayWidget::handleKeyPress(not_null e) { } _processingKeyPress = true; const auto guard = gsl::finally([&] { _processingKeyPress = false; }); - const auto key = e->key(); + const auto key = LayoutIndependentKey(e); const auto modifiers = e->modifiers(); const auto ctrl = modifiers.testFlag(Qt::ControlModifier); if (_stories) { @@ -8714,7 +8724,7 @@ bool OverlayWidget::filterApplicationEvent( const auto type = e->type(); if (type == QEvent::ShortcutOverride) { const auto event = static_cast(e.get()); - const auto key = event->key(); + const auto key = LayoutIndependentKey(event); const auto ctrl = event->modifiers().testFlag(Qt::ControlModifier); if (key == Qt::Key_F && ctrl && _streamed) { playbackToggleFullScreen();