diff --git a/web/src/compose.js b/web/src/compose.js index 573b449ebc0682..6d011261416eb1 100644 --- a/web/src/compose.js +++ b/web/src/compose.js @@ -272,10 +272,10 @@ export function rewire_send_message(value) { send_message = value; } -export function handle_enter_key_with_preview_open(ctrl_pressed = false) { +export function handle_enter_key_with_preview_open(ctrl_or_cmd_pressed = false) { if ( - (user_settings.enter_sends && !ctrl_pressed) || - (!user_settings.enter_sends && ctrl_pressed) + (user_settings.enter_sends && !ctrl_or_cmd_pressed) || + (!user_settings.enter_sends && ctrl_or_cmd_pressed) ) { // If this enter should send, we attempt to send the message. finish(); diff --git a/web/src/hotkey.js b/web/src/hotkey.js index c0574ec1435268..85c06ece2a2772 100644 --- a/web/src/hotkey.js +++ b/web/src/hotkey.js @@ -117,10 +117,10 @@ const keydown_unshift_mappings = { const keydown_ctrl_mappings = { 219: {name: "escape", message_view_only: false}, // '[' - 13: {name: "ctrl_enter", message_view_only: true}, // enter }; const keydown_cmd_or_ctrl_mappings = { + 13: {name: "action_with_enter", message_view_only: true}, // 'Enter' 67: {name: "copy_with_c", message_view_only: false}, // 'C' 75: {name: "search_with_k", message_view_only: false}, // 'K' 83: {name: "star_message", message_view_only: true}, // 'S' @@ -580,10 +580,10 @@ export function process_enter_key(e) { return true; } -export function process_ctrl_enter_key() { +export function process_cmd_or_ctrl_enter_key() { if ($("#preview_message_area").is(":visible")) { - const ctrl_pressed = true; - compose.handle_enter_key_with_preview_open(ctrl_pressed); + const ctrl_or_cmd_pressed = true; + compose.handle_enter_key_with_preview_open(ctrl_or_cmd_pressed); return true; } @@ -710,8 +710,8 @@ export function process_hotkey(e, hotkey) { return process_escape_key(e); case "enter": return process_enter_key(e); - case "ctrl_enter": - return process_ctrl_enter_key(e); + case "action_with_enter": + return process_cmd_or_ctrl_enter_key(e); case "tab": return process_tab_key(); case "shift_tab":