|
|
|
@ -27,13 +27,16 @@ export class CommandStore
|
|
|
|
|
this.index++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
get InputIsFoucs(): Boolean
|
|
|
|
|
{
|
|
|
|
|
return document.activeElement.id == "command-input";
|
|
|
|
|
}
|
|
|
|
|
private RegionKeyDownEvent()
|
|
|
|
|
{
|
|
|
|
|
window.document.addEventListener("keydown", (e: KeyboardEvent) =>
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (document.activeElement.id != "command-input")
|
|
|
|
|
if (!this.InputIsFoucs)
|
|
|
|
|
{
|
|
|
|
|
if (IsNumble(e.keyCode) || IsChar(e.keyCode))
|
|
|
|
|
{
|
|
|
|
@ -49,9 +52,18 @@ export class CommandStore
|
|
|
|
|
|
|
|
|
|
keyDownHandle = (keyCode: number) =>
|
|
|
|
|
{
|
|
|
|
|
console.log(keyCode);
|
|
|
|
|
let inpValue: string = this.elInput.value;
|
|
|
|
|
switch (keyCode)
|
|
|
|
|
{
|
|
|
|
|
case 8:
|
|
|
|
|
{
|
|
|
|
|
if (!this.InputIsFoucs)
|
|
|
|
|
{
|
|
|
|
|
this.elInput.value = this.elInput.value.slice(0, -1)
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
case 13:
|
|
|
|
|
case 32:
|
|
|
|
|
if (inpValue != "")
|
|
|
|
|