fix infiltration keybinding

This commit is contained in:
Olivier Gagnon
2021-09-24 22:15:19 -04:00
parent 76e6cb4ecc
commit 65cb519801
10 changed files with 21 additions and 21 deletions
+2 -2
View File
@@ -36,7 +36,7 @@ function generateLeftSide(difficulty: Difficulty): string {
return str;
}
function getChar(event: React.KeyboardEvent<HTMLElement>): string {
function getChar(event: KeyboardEvent): string {
if (event.keyCode == 48 && event.shiftKey) return ")";
if (event.keyCode == 221 && !event.shiftKey) return "]";
if (event.keyCode == 221 && event.shiftKey) return "}";
@@ -60,7 +60,7 @@ export function BracketGame(props: IMinigameProps): React.ReactElement {
const [right, setRight] = useState("");
const [left] = useState(generateLeftSide(difficulty));
function press(event: React.KeyboardEvent<HTMLElement>): void {
function press(this: Document, event: KeyboardEvent): void {
event.preventDefault();
const char = getChar(event);
if (!char) return;