mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Continue with AltGr+Enter
This commit is contained in:
@@ -906,10 +906,13 @@ export function initRossMods() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$(document).on('keydown', function (event) {
|
$(document).on('keydown', function (event) {
|
||||||
processHotkeys(event);
|
processHotkeys(event.originalEvent);
|
||||||
});
|
});
|
||||||
|
|
||||||
//Additional hotkeys CTRL+ENTER and CTRL+UPARROW
|
//Additional hotkeys CTRL+ENTER and CTRL+UPARROW
|
||||||
|
/**
|
||||||
|
* @param {KeyboardEvent} event
|
||||||
|
*/
|
||||||
function processHotkeys(event) {
|
function processHotkeys(event) {
|
||||||
//Enter to send when send_textarea in focus
|
//Enter to send when send_textarea in focus
|
||||||
if ($(':focus').attr('id') === 'send_textarea') {
|
if ($(':focus').attr('id') === 'send_textarea') {
|
||||||
@@ -943,6 +946,14 @@ export function initRossMods() {
|
|||||||
}, 300);
|
}, 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
|
// Ctrl+Enter for Regeneration Last Response. If editing, accept the edits instead
|
||||||
if (event.ctrlKey && event.key == "Enter") {
|
if (event.ctrlKey && event.key == "Enter") {
|
||||||
const editMesDone = $(".mes_edit_done:visible");
|
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
|
// Helper function to check if nanogallery2's lightbox is active
|
||||||
function isNanogallery2LightboxActive() {
|
function isNanogallery2LightboxActive() {
|
||||||
// Check if the body has the 'nGY2On' class, adjust this based on actual behavior
|
// Check if the body has the 'nGY2On' class, adjust this based on actual behavior
|
||||||
|
Reference in New Issue
Block a user