summaryrefslogtreecommitdiff
path: root/client-web/source/keybinds.ts
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2022-12-25 13:53:26 +0100
committermetamuffin <metamuffin@disroot.org>2022-12-25 13:53:26 +0100
commitac68f06d230fd589edb9b1d13af50836d554f23e (patch)
tree00cf3d10cec1e024cf53cf434f17d6b1fadcdaae /client-web/source/keybinds.ts
parent7dc0c3ec6f982377f6c2e2e87c983c5d4b5870c6 (diff)
downloadkeks-meet-ac68f06d230fd589edb9b1d13af50836d554f23e.tar
keks-meet-ac68f06d230fd589edb9b1d13af50836d554f23e.tar.bz2
keks-meet-ac68f06d230fd589edb9b1d13af50836d554f23e.tar.zst
optimize accessability (screen readers 'n stuff)
Diffstat (limited to 'client-web/source/keybinds.ts')
-rw-r--r--client-web/source/keybinds.ts13
1 files changed, 4 insertions, 9 deletions
diff --git a/client-web/source/keybinds.ts b/client-web/source/keybinds.ts
index 5463e47..d096501 100644
--- a/client-web/source/keybinds.ts
+++ b/client-web/source/keybinds.ts
@@ -10,28 +10,23 @@ import { Room } from "./room.ts"
import { update_serviceworker } from "./sw/init.ts";
export function setup_keybinds(room: Room) {
- let command_mode = false
+ // let command_mode = false
document.body.addEventListener("keydown", ev => {
// TODO is there a proper solution?
if (ev.target instanceof HTMLInputElement && !(ev.target.type == "button")) return
if (ev.repeat) return
- if (ev.code == "Enter") {
+ if (ev.code == "Enter" && ev.ctrlKey) {
room.chat.shown = !room.chat.shown
if (room.chat.shown) room.chat.focus()
ev.preventDefault() // so focused buttons dont trigger
}
- if (ev.code == "Space") {
- command_mode = true
- ev.preventDefault() // so focused buttons dont trigger
- return
- }
- if (command_mode) {
+ if (ev.shiftKey) {
if (ev.code == "KeyM" || ev.code == "KeyR") room.local_user.await_add_resource(create_mic_res())
if (ev.code == "KeyS") room.local_user.await_add_resource(create_screencast_res())
if (ev.code == "KeyC" && !ev.ctrlKey) room.local_user.await_add_resource(create_camera_res())
if (ev.code == "KeyC" && ev.ctrlKey) room.local_user.resources.forEach(t => t.destroy())
if (ev.code == "KeyU") if (window.confirm("really update?")) update_serviceworker()
}
- command_mode = false
+ // command_mode = false
})
}