Improve input

This commit is contained in:
2026-10-07 13:59:23 -03:00
parent 8f8030c02e
commit 3ec25c1471
3 changed files with 163 additions and 1 deletions
+6
View File
@@ -8,6 +8,7 @@ import { type Host, serve_static, start_host } from "../server/host.ts";
import { PROTOCOL_VERSION } from "../common/protocol.ts";
import { current_client, update_client } from "./client_updates.ts";
import { guard_shortcuts } from "./shortcuts.ts";
import { center_mouse } from "./center_mouse.ts";
// where the project was built from: build/ and server_mods/ (the .bmod files) are bundled into the app with --include
const ROOT = fromFileUrl(new URL("../", import.meta.url));
@@ -92,6 +93,11 @@ Deno.serve(async (req) => {
start.searchParams.set("singleplayer", "");
return Response.redirect(start, 302);
}
// the page let go of the mouse, see center_mouse.ts
if (url.pathname === "/desktop/center_mouse" && req.method === "POST") {
center_mouse();
return new Response(null, { status: 204 });
}
// the singleplayer server's socket and its .bmod downloads
if (url.pathname === "/ws" || url.pathname.startsWith("/mods/")) {
try {