mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
No swiping hotkeys when modifiers are held.
This commit is contained in:
@@ -1018,6 +1018,14 @@ export function initRossMods() {
|
||||
return false;
|
||||
}
|
||||
|
||||
function isModifiedKeyboardEvent(event) {
|
||||
return (event instanceof KeyboardEvent &&
|
||||
event.shiftKey ||
|
||||
event.ctrlKey ||
|
||||
event.altKey ||
|
||||
event.metaKey);
|
||||
}
|
||||
|
||||
$(document).on('keydown', async function (event) {
|
||||
await processHotkeys(event.originalEvent);
|
||||
});
|
||||
@@ -1141,7 +1149,8 @@ export function initRossMods() {
|
||||
$('#send_textarea').val() === '' &&
|
||||
$('#character_popup').css('display') === 'none' &&
|
||||
$('#shadow_select_chat_popup').css('display') === 'none' &&
|
||||
!isInputElementInFocus()
|
||||
!isInputElementInFocus() &&
|
||||
!isModifiedKeyboardEvent(event)
|
||||
) {
|
||||
$('.swipe_left:last').trigger('click', { source: 'keyboard', repeated: event.repeat });
|
||||
return;
|
||||
@@ -1154,7 +1163,8 @@ export function initRossMods() {
|
||||
$('#send_textarea').val() === '' &&
|
||||
$('#character_popup').css('display') === 'none' &&
|
||||
$('#shadow_select_chat_popup').css('display') === 'none' &&
|
||||
!isInputElementInFocus()
|
||||
!isInputElementInFocus() &&
|
||||
!isModifiedKeyboardEvent(event)
|
||||
) {
|
||||
$('.swipe_right:last').trigger('click', { source: 'keyboard', repeated: event.repeat });
|
||||
return;
|
||||
|
Reference in New Issue
Block a user