From 6706b3882d05a62faa67f77b72148106bdeca749 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 13 Mar 2016 20:50:00 +0300 Subject: [PATCH] shortcuts repeat mode is defined by the command --- Telegram/SourceFiles/shortcuts.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/shortcuts.cpp b/Telegram/SourceFiles/shortcuts.cpp index 149bea95e2..d1258a8730 100644 --- a/Telegram/SourceFiles/shortcuts.cpp +++ b/Telegram/SourceFiles/shortcuts.cpp @@ -263,6 +263,13 @@ namespace Shortcuts { QMap sequences; QMap handlers; + + QSet autoRepeatCommands = { + qsl("media_previous"), + qsl("media_next"), + qsl("next_chat"), + qsl("previous_chat"), + }; }; void _createCommand(const QString &command, ShortcutCommands::Handler handler) { @@ -287,7 +294,9 @@ namespace Shortcuts { LOG(("Warning: could not find shortcut command handler '%1'").arg(command)); } else { QShortcut *shortcut(new QShortcut(seq, App::wnd(), nullptr, nullptr, Qt::ApplicationShortcut)); - shortcut->setAutoRepeat(false); + if (!DataPtr->autoRepeatCommands.contains(command)) { + shortcut->setAutoRepeat(false); + } int shortcutId = shortcut->id(); if (!shortcutId) { DataPtr->errors.push_back(qsl("Could not create shortcut '%1'!").arg(keys));