From 10e2fbd4992c6ad6993b4f8eb31bcd5e7e046f83 Mon Sep 17 00:00:00 2001 From: Ethan Waldo Date: Wed, 4 Jan 2023 23:33:00 -0500 Subject: [PATCH] Use Keyboard API to lock screen for supported browsers When using fullscreen mode, hitting the escape key will exit out of fullscreen mode. To stay in fullscreen mode but pass the escape key through, we can use the Keyboard API to require the escape key be held down https://wicg.github.io/keyboard-lock/#escape-key. Tested in Chrome which supports Keyboard API and Firefox which does not https://caniuse.com/?search=navigator.keyboard with no errors in either case. --- client/src/components/video.vue | 3 ++- client/src/types/navigator.keyboard.d.ts | 15 +++++++++++++++ client/src/utils/index.ts | 12 ++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 client/src/types/navigator.keyboard.d.ts diff --git a/client/src/components/video.vue b/client/src/components/video.vue index a93893e..ac3c3bc 100644 --- a/client/src/components/video.vue +++ b/client/src/components/video.vue @@ -194,7 +194,7 @@