-
-
Topos Prototype
-
-
-
This is Topos, an experimental live coding platform.
-
Switch to the Help (Ctrl+b) universe for a tutorial!
-
Have fun, press Enter/Space to get started!
-
+
diff --git a/src/main.ts b/src/main.ts
index 1e82771..5ba19ac 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -693,6 +693,8 @@ function startClock() {
document
.getElementById("start-button")!
.removeEventListener("click", startClock);
+ document
+ .removeEventListener("click", startClock);
document.removeEventListener("keydown", startOnEnter);
app.clock.start();
app.view.focus();
@@ -702,9 +704,13 @@ function startClock() {
function startOnEnter(e: KeyboardEvent) {
if (e.code === "Enter" || e.code === "Space") startClock();
}
+function startOnClick(e: MouseEvent) {
+ if (e.button === 0) startClock();
+}
document.addEventListener("keydown", startOnEnter);
-document.getElementById("start-button")!.addEventListener("click", startClock);
+document.addEventListener("click", startOnClick);
+// document.getElementById("start-button")!.addEventListener("click", startClock);
/**
* @param event The mouse event