Merge pull request #4297 from matrix-org/t3chguy/kbd11
Keyboard shortcuts: Escape cancel reply and fix Ctrl+K
This commit is contained in:
commit
90b8d87a39
4 changed files with 13 additions and 1 deletions
|
@ -118,6 +118,11 @@ const shortcuts: Record<Categories, IShortcut[]> = {
|
||||||
key: Key.ARROW_DOWN,
|
key: Key.ARROW_DOWN,
|
||||||
}],
|
}],
|
||||||
description: _td("Navigate composer history"),
|
description: _td("Navigate composer history"),
|
||||||
|
}, {
|
||||||
|
keybinds: [{
|
||||||
|
key: Key.ESCAPE,
|
||||||
|
}],
|
||||||
|
description: _td("Cancel replying to a message"),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
|
@ -657,6 +657,7 @@ export default createReactClass({
|
||||||
collapseLhs: true,
|
collapseLhs: true,
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case 'focus_room_filter': // for CtrlOrCmd+K to work by expanding the left panel first
|
||||||
case 'show_left_panel':
|
case 'show_left_panel':
|
||||||
this.setState({
|
this.setState({
|
||||||
collapseLhs: false,
|
collapseLhs: false,
|
||||||
|
|
|
@ -131,8 +131,13 @@ export default class SendMessageComposer extends React.Component {
|
||||||
this.onVerticalArrow(event, false);
|
this.onVerticalArrow(event, false);
|
||||||
} else if (this._prepareToEncrypt) {
|
} else if (this._prepareToEncrypt) {
|
||||||
this._prepareToEncrypt();
|
this._prepareToEncrypt();
|
||||||
|
} else if (event.key === Key.ESCAPE) {
|
||||||
|
dis.dispatch({
|
||||||
|
action: 'reply_to_event',
|
||||||
|
event: null,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
onVerticalArrow(e, up) {
|
onVerticalArrow(e, up) {
|
||||||
// arrows from an initial-caret composer navigates recent messages to edit
|
// arrows from an initial-caret composer navigates recent messages to edit
|
||||||
|
|
|
@ -2216,6 +2216,7 @@
|
||||||
"Navigate recent messages to edit": "Navigate recent messages to edit",
|
"Navigate recent messages to edit": "Navigate recent messages to edit",
|
||||||
"Jump to start/end of the composer": "Jump to start/end of the composer",
|
"Jump to start/end of the composer": "Jump to start/end of the composer",
|
||||||
"Navigate composer history": "Navigate composer history",
|
"Navigate composer history": "Navigate composer history",
|
||||||
|
"Cancel replying to a message": "Cancel replying to a message",
|
||||||
"Toggle microphone mute": "Toggle microphone mute",
|
"Toggle microphone mute": "Toggle microphone mute",
|
||||||
"Toggle video on/off": "Toggle video on/off",
|
"Toggle video on/off": "Toggle video on/off",
|
||||||
"Jump to room search": "Jump to room search",
|
"Jump to room search": "Jump to room search",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue