diff --git a/public/scripts/RossAscends-mods.js b/public/scripts/RossAscends-mods.js index 5598010b9..99ffdfc13 100644 --- a/public/scripts/RossAscends-mods.js +++ b/public/scripts/RossAscends-mods.js @@ -906,10 +906,13 @@ export function initRossMods() { } $(document).on('keydown', function (event) { - processHotkeys(event); + processHotkeys(event.originalEvent); }); //Additional hotkeys CTRL+ENTER and CTRL+UPARROW + /** + * @param {KeyboardEvent} event + */ function processHotkeys(event) { //Enter to send when send_textarea in focus if ($(':focus').attr('id') === 'send_textarea') { @@ -943,6 +946,14 @@ export function initRossMods() { }, 300); } + // Alt+Enter or AltGr+Enter to Continue + if ((event.altKey || (event.altKey && event.ctrlKey)) && event.key == "Enter") { + if (is_send_press == false) { + console.debug("Continuing with Alt+Enter"); + $('#option_continue').trigger('click'); + } + } + // Ctrl+Enter for Regeneration Last Response. If editing, accept the edits instead if (event.ctrlKey && event.key == "Enter") { const editMesDone = $(".mes_edit_done:visible"); @@ -958,14 +969,6 @@ export function initRossMods() { } } - // Alt+Enter to Continue - if (event.altKey && event.key == "Enter") { - if (is_send_press == false) { - console.debug("Continuing with Alt+Enter"); - $('#option_continue').trigger('click'); - } - } - // Helper function to check if nanogallery2's lightbox is active function isNanogallery2LightboxActive() { // Check if the body has the 'nGY2On' class, adjust this based on actual behavior