Skip to content

Commit

Permalink
[IMPROVE] Add CTRL modifier for keyboard shortcut (#12525)
Browse files Browse the repository at this point in the history
* Add CTRL modifier for keyboard shortcut

As pointed out in #12519 Chrome already uses `Shift+ESC`, colliding
with the 'mark all messages as read' keyboard shortcut in
RocketChat. This change adds the `CTRL` modifier to the shortcut,
i.e. mapping

     Shift+ESC | CTRL+ESC

* Add documentation for keyboard shortcut

This change adds (english) documentation for the keyboard shortcut.
  • Loading branch information
nicolasbock authored and rodrigok committed Nov 6, 2018
1 parent b4debdc commit 57eb4d5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1757,6 +1757,7 @@
"MapView_Enabled_Description": "Enabling mapview will display a location share button on the left of the chat input field.",
"MapView_GMapsAPIKey": "Google Static Maps API Key",
"MapView_GMapsAPIKey_Description": "This can be obtained from the Google Developers Console for free.",
"Mark_all_as_read": "Mark all messages as read",
"Mark_as_read": "Mark As Read",
"Mark_as_unread": "Mark As Unread",
"Markdown_Headers": "Allow Markdown headers in messages",
Expand Down Expand Up @@ -2937,4 +2938,4 @@
"Your_push_was_sent_to_s_devices": "Your push was sent to %s devices",
"Your_server_link": "Your server link",
"Your_workspace_is_ready": "Your workspace is ready to use 🎉"
}
}
3 changes: 3 additions & 0 deletions packages/rocketchat-slashcommands-help/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ RocketChat.slashCommands.add('help', function Help(command, params, item) {
const keys = [{
Open_channel_user_search: 'Command (or Ctrl) + p OR Command (or Ctrl) + k',
},
{
Mark_all_as_read: 'Shift (or Ctrl) + ESC',
},
{
Edit_previous_message: 'Up Arrow',
},
Expand Down
2 changes: 1 addition & 1 deletion packages/rocketchat-ui-master/client/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Template.body.onRendered(function() {
toolbarSearch.show(true);
}
const unread = Session.get('unread');
if (e.keyCode === 27 && e.shiftKey === true && (unread != null) && unread !== '') {
if (e.keyCode === 27 && (e.shiftKey === true || e.ctrlKey === true) && (unread != null) && unread !== '') {
e.preventDefault();
e.stopPropagation();
modal.open({
Expand Down

0 comments on commit 57eb4d5

Please sign in to comment.