mirror of
https://example.com
synced 2024-11-24 07:26:39 +09:00
Enter sends message, ctrl/meta/shift + enter makes newline
This commit is contained in:
parent
b9f9fe2927
commit
50a7d10f27
1 changed files with 4 additions and 1 deletions
|
@ -125,7 +125,10 @@ function onDrop(ev: DragEvent): void {
|
|||
|
||||
function onKeydown(ev: KeyboardEvent) {
|
||||
typing();
|
||||
if ((ev.key === 'Enter') && (ev.ctrlKey || ev.metaKey) && canSend) {
|
||||
if ((ev.key === 'Enter') && (ev.ctrlKey || ev.metaKey || ev.shiftKey) && canSend) {
|
||||
textEl.value += '\n'
|
||||
}
|
||||
else if (ev.key === 'Enter' && canSend) {
|
||||
send();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue