keyEventWasInInput() function added.

This commit is contained in:
PeekabooSteam
2023-04-04 15:51:11 +01:00
parent ff20eec472
commit 6ffcb76f03
3 changed files with 16 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ import { getMap, getUnitDataTable } from "..";
import { Unit } from "./unit";
import { cloneUnit } from "../server/server";
import { IDLE, MOVE_UNIT } from "../map/map";
import { keyEventWasInInput } from "../other/utils";
export class UnitsManager {
#units: { [ID: number]: Unit };
@@ -345,7 +346,7 @@ export class UnitsManager {
#onKeyDown(event: KeyboardEvent)
{
if (event.key === "Delete")
if ( !keyEventWasInInput( event ) && event.key === "Delete")
{
this.selectedUnitsDelete();
}