From cb91d7037f574fecb1d36f4a23717d123f0ca85c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Sun, 17 Jan 2021 08:28:52 +0100 Subject: [PATCH] Added search shortcut MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/structures/LoggedInView.tsx | 8 ++++++++ src/components/structures/RoomView.tsx | 3 +++ 2 files changed, 11 insertions(+) diff --git a/src/components/structures/LoggedInView.tsx b/src/components/structures/LoggedInView.tsx index ec5afd13f0..f34427ba88 100644 --- a/src/components/structures/LoggedInView.tsx +++ b/src/components/structures/LoggedInView.tsx @@ -419,6 +419,14 @@ class LoggedInView extends React.Component { handled = true; } break; + case Key.F: + if (ctrlCmdOnly) { + dis.dispatch({ + action: 'focus_search', + }); + handled = true; + } + break; case Key.BACKTICK: // Ideally this would be CTRL+P for "Profile", but that's // taken by the print dialog. CTRL+I for "Information" diff --git a/src/components/structures/RoomView.tsx b/src/components/structures/RoomView.tsx index 0ee847fbc9..c4e88b5781 100644 --- a/src/components/structures/RoomView.tsx +++ b/src/components/structures/RoomView.tsx @@ -748,6 +748,9 @@ export default class RoomView extends React.Component { }); } break; + case 'focus_search': + this.onSearchClick(); + break; } };