mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-02 19:07:40 +01:00
Merge pull request #2677 from SillyTavern/popups-suppress-default-hotkeys
Open popups should block all default hotkeys
This commit is contained in:
commit
86af35afdd
@ -954,6 +954,11 @@ export function initRossMods() {
|
|||||||
* @param {KeyboardEvent} event
|
* @param {KeyboardEvent} event
|
||||||
*/
|
*/
|
||||||
async function processHotkeys(event) {
|
async function processHotkeys(event) {
|
||||||
|
// Default hotkeys and shortcuts shouldn't work if any popup is currently open
|
||||||
|
if (Popup.util.isPopupOpen()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//Enter to send when send_textarea in focus
|
//Enter to send when send_textarea in focus
|
||||||
if (document.activeElement == hotkeyTargets['send_textarea']) {
|
if (document.activeElement == hotkeyTargets['send_textarea']) {
|
||||||
const sendOnEnter = shouldSendOnEnter();
|
const sendOnEnter = shouldSendOnEnter();
|
||||||
@ -1107,10 +1112,6 @@ export function initRossMods() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (event.key == 'Escape') { //closes various panels
|
if (event.key == 'Escape') { //closes various panels
|
||||||
// Do not close panels if we are currently inside a popup
|
|
||||||
if (Popup.util.isPopupOpen())
|
|
||||||
return;
|
|
||||||
|
|
||||||
//dont override Escape hotkey functions from script.js
|
//dont override Escape hotkey functions from script.js
|
||||||
//"close edit box" and "cancel stream generation".
|
//"close edit box" and "cancel stream generation".
|
||||||
if ($('#curEditTextarea').is(':visible') || $('#mes_stop').is(':visible')) {
|
if ($('#curEditTextarea').is(':visible') || $('#mes_stop').is(':visible')) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user