Add a fullscreen button and the keyboard lock API (#266)

Closes #249
This commit is contained in:
Keavon Chambers
2021-07-14 18:56:22 -07:00
committed by GitHub
parent 83a955522e
commit 34f058147e
14 changed files with 151 additions and 17 deletions
+2
View File
@@ -1,9 +1,11 @@
import { createApp } from "vue";
import { fullscreenModeChanged } from "@/utilities/fullscreen";
import { handleKeyUp, handleKeyDown } from "@/utilities/input";
import App from "./App.vue";
// Bind global browser events
document.addEventListener("contextmenu", (e) => e.preventDefault());
document.addEventListener("fullscreenchange", () => fullscreenModeChanged());
window.addEventListener("keyup", (e: KeyboardEvent) => handleKeyUp(e));
window.addEventListener("keydown", (e: KeyboardEvent) => handleKeyDown(e));