add escape button startz

This commit is contained in:
MeexReay 2025-03-22 02:03:15 +03:00
parent ffbdf89609
commit cc679a5922

View File

@ -7,7 +7,22 @@ async function main(args) {
let ctx = getGraphics()
let run = true
(async () => {
while (true) {
let event = await pollStdinEvent()
if (event.type == "key") {
if (event.key == "Escape") {
run = false
return
}
}
}
})()
while (run) {
ctx.fillStyle = "black"
ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height)