aboutsummaryrefslogtreecommitdiff
path: root/webAO/dom/onOOCEnter.ts
diff options
context:
space:
mode:
Diffstat (limited to 'webAO/dom/onOOCEnter.ts')
-rw-r--r--webAO/dom/onOOCEnter.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/webAO/dom/onOOCEnter.ts b/webAO/dom/onOOCEnter.ts
new file mode 100644
index 0000000..d7ec21b
--- /dev/null
+++ b/webAO/dom/onOOCEnter.ts
@@ -0,0 +1,15 @@
+import { client } from "../client";
+/**
+ * Triggered when the Return key is pressed on the out-of-character chat input box.
+ * @param {KeyboardEvent} event
+ */
+export function onOOCEnter(event: KeyboardEvent) {
+ if (event.keyCode === 13) {
+ client.sender.sendOOC(
+ (<HTMLInputElement>document.getElementById("client_oocinputbox")).value
+ );
+ (<HTMLInputElement>document.getElementById("client_oocinputbox")).value =
+ "";
+ }
+}
+window.onOOCEnter = onOOCEnter;