From 4233aca561b5650924f3cc4232cfd294d706c863 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Sat, 2 Mar 2024 06:00:47 -0700 Subject: refocus canvas on lambda factory clsoe --- src/components/GameCanvas.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/components') diff --git a/src/components/GameCanvas.tsx b/src/components/GameCanvas.tsx index 0ea7180..09351e3 100644 --- a/src/components/GameCanvas.tsx +++ b/src/components/GameCanvas.tsx @@ -1,5 +1,6 @@ import { useState, useEffect, useRef } from "react"; import { TheAbstractionEngine, Game } from "../engine"; +import { Miscellaneous } from "../engine/config"; export interface GameCanvasProps { width: number; @@ -21,6 +22,8 @@ export const GameCanvas = ({ width, height }: GameCanvasProps) => { theAbstractionEngine.init().then(() => { theAbstractionEngine.play(); setGame(theAbstractionEngine); + + canvas.focus(); }); return () => theAbstractionEngine.stop(); @@ -30,7 +33,13 @@ export const GameCanvas = ({ width, height }: GameCanvasProps) => { return (
- +
); }; -- cgit v1.2.3-70-g09d2