[feat] change with enter
This commit is contained in:
@@ -278,5 +278,6 @@ export const languageEnglish = {
|
||||
charLoreBook: 'Character Lorebook',
|
||||
globalLoreBook: 'Global Lorebook',
|
||||
globalRegexScript: "Global Regex",
|
||||
accessibility: "Accessibility"
|
||||
accessibility: "Accessibility",
|
||||
sendWithEnter: "Send with Enter Key"
|
||||
}
|
||||
@@ -205,8 +205,10 @@
|
||||
bind:this={inputEle}
|
||||
on:keydown={(e) => {
|
||||
if(e.key.toLocaleLowerCase() === "enter" && (!e.shiftKey)){
|
||||
send()
|
||||
e.preventDefault()
|
||||
if($DataBase.sendWithEnter){
|
||||
send()
|
||||
e.preventDefault()
|
||||
}
|
||||
}
|
||||
if(e.key.toLocaleLowerCase() === "m" && (e.ctrlKey)){
|
||||
reroll()
|
||||
|
||||
@@ -20,3 +20,8 @@
|
||||
<Check bind:check={$DataBase.instantRemove}/>
|
||||
<span>{language.instantRemove}</span>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center mt-2">
|
||||
<Check bind:check={$DataBase.sendWithEnter}/>
|
||||
<span>{language.sendWithEnter}</span>
|
||||
</div>
|
||||
|
||||
@@ -251,6 +251,9 @@ export function setDatabase(data:Database){
|
||||
if(checkNullish(data.globalscript)){
|
||||
data.globalscript = []
|
||||
}
|
||||
if(checkNullish(data.sendWithEnter)){
|
||||
data.sendWithEnter = true
|
||||
}
|
||||
|
||||
|
||||
changeLanguage(data.language)
|
||||
@@ -481,6 +484,7 @@ export interface Database{
|
||||
model:string
|
||||
}
|
||||
globalscript: customscript[]
|
||||
sendWithEnter:boolean
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user