From 2a54a8aa859a5a20e4693211ca1e0534587a581f Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sun, 29 Mar 2020 20:33:01 +0100 Subject: [PATCH 1/3] Escape should cancel a reply Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/rooms/SendMessageComposer.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/views/rooms/SendMessageComposer.js b/src/components/views/rooms/SendMessageComposer.js index 90c37780fe..d87d99dc46 100644 --- a/src/components/views/rooms/SendMessageComposer.js +++ b/src/components/views/rooms/SendMessageComposer.js @@ -131,8 +131,13 @@ export default class SendMessageComposer extends React.Component { this.onVerticalArrow(event, false); } else if (this._prepareToEncrypt) { this._prepareToEncrypt(); + } else if (event.key === Key.ESCAPE) { + dis.dispatch({ + action: 'reply_to_event', + event: null, + }); } - } + }; onVerticalArrow(e, up) { // arrows from an initial-caret composer navigates recent messages to edit From acc41585abf3c5608a9661b7fb552ca488d713a4 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sun, 29 Mar 2020 20:33:27 +0100 Subject: [PATCH 2/3] Fix CmdOrCtrl+K for collapsed LHS Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/MatrixChat.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 52002f0591..9d17cd8647 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -657,6 +657,7 @@ export default createReactClass({ collapseLhs: true, }); break; + case 'focus_room_filter': // for CtrlOrCmd+K to work by expanding the left panel first case 'show_left_panel': this.setState({ collapseLhs: false, From 167f953ac7653df88ee7378d846147d9ba8b2721 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sun, 29 Mar 2020 20:35:35 +0100 Subject: [PATCH 3/3] Document Composer:Escape to cancel a reply Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/accessibility/KeyboardShortcuts.tsx | 5 +++++ src/i18n/strings/en_EN.json | 1 + 2 files changed, 6 insertions(+) diff --git a/src/accessibility/KeyboardShortcuts.tsx b/src/accessibility/KeyboardShortcuts.tsx index c2739beefa..bcbf3d6810 100644 --- a/src/accessibility/KeyboardShortcuts.tsx +++ b/src/accessibility/KeyboardShortcuts.tsx @@ -118,6 +118,11 @@ const shortcuts: Record = { key: Key.ARROW_DOWN, }], description: _td("Navigate composer history"), + }, { + keybinds: [{ + key: Key.ESCAPE, + }], + description: _td("Cancel replying to a message"), }, ], diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index a6e195aa16..2f19fc982c 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -2216,6 +2216,7 @@ "Navigate recent messages to edit": "Navigate recent messages to edit", "Jump to start/end of the composer": "Jump to start/end of the composer", "Navigate composer history": "Navigate composer history", + "Cancel replying to a message": "Cancel replying to a message", "Toggle microphone mute": "Toggle microphone mute", "Toggle video on/off": "Toggle video on/off", "Jump to room search": "Jump to room search",