diff --git a/webAO/dom/onEnter.ts b/webAO/dom/onEnter.ts index 49487832..870b7f35 100644 --- a/webAO/dom/onEnter.ts +++ b/webAO/dom/onEnter.ts @@ -6,7 +6,7 @@ import { escapeChat } from "../encoding"; * @param {KeyboardEvent} event */ export function onEnter(event: KeyboardEvent) { - if (event.keyCode === 13) { + if (event.key === "Enter") { const mychar = client.character; const myemo = client.emote; const evi = client.evidence; @@ -68,6 +68,11 @@ export function onEnter(event: KeyboardEvent) { emote_mod = 0; } + // Never send empty messages + if (text === '') { + return false; + } + client.sender.sendIC( myemo.deskmod, myemo.preanim,