}
}
+ // Keys that are capable of opening the text input.
+ const hotKeyRange = keyboardNameMap.slice(47, 91)
+ const isHotKey = (key: string) => {
+ if (hotKeyRange.includes(key)) {
+ return true
+ }
+ }
+
//---Callbacks-----------------------------------------------
const onKeyDown = (e: KeyboardEvent) => {
if (textInput) {
- // First-key handler.
+ // Only runs on firstKey.
if (firstKey) {
- if (key == "SPACE") return
+
+ if (!isHotKey(key)) {
+ return
+ }
+
prepInput()
}
textInput.focus();
// Close input when no text or on ESC.
- if (textInput.value == "" && !firstKey) {
+ if ((textInput.value == "") && (!firstKey) && (key === "BACK_SPACE")) {
clearInput()
return
}
//-----------------------------------------------------------
// Watch parent position and update side.
- watch(elementX, (elementX, previous) => {
+ watch(elementX, (elementX, _previous) => {
const winW = window.innerWidth
// Logic depends on the side we are on.
if (messages.value.size >= 200) {
const oldest = Array.from(messages.value.keys()).shift();
messages.value.delete(oldest);
- };
+ }
// Step 4: Update grouping.
updateGrouping()
messages,
updateMessageView
}
-};
\ No newline at end of file
+}
\ No newline at end of file
-{"w":735,"h":510,"x":1354,"y":513}
\ No newline at end of file
+{"w":735,"h":510,"x":944,"y":489}
\ No newline at end of file