From a531db81ebfc79b36f12c0aebc4192cad5b661d2 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sun, 11 Sep 2022 10:58:32 +0200 Subject: keybinds --- client-web/source/keybinds.ts | 5 +++-- client-web/source/user/mod.ts | 2 +- readme.md | 15 +++++++++------ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/client-web/source/keybinds.ts b/client-web/source/keybinds.ts index 311b55a..ad20d37 100644 --- a/client-web/source/keybinds.ts +++ b/client-web/source/keybinds.ts @@ -18,9 +18,10 @@ export function setup_keybinds(room: Room) { return } if (command_mode) { - if (ev.code == "KeyM") room.local_user.publish_track(room.local_user.create_mic_track()) - if (ev.code == "KeyC") room.local_user.publish_track(room.local_user.create_camera_track()) + if (ev.code == "KeyM" || ev.code == "KeyR") room.local_user.publish_track(room.local_user.create_mic_track()) if (ev.code == "KeyS") room.local_user.publish_track(room.local_user.create_screencast_track()) + if (ev.code == "KeyC" && !ev.ctrlKey) room.local_user.publish_track(room.local_user.create_camera_track()) + if (ev.code == "KeyC" && ev.ctrlKey) room.local_user.tracks.forEach(t => t.end()) } command_mode = false }) diff --git a/client-web/source/user/mod.ts b/client-web/source/user/mod.ts index b01dc16..e2db9e9 100644 --- a/client-web/source/user/mod.ts +++ b/client-web/source/user/mod.ts @@ -9,7 +9,7 @@ import { TrackHandle } from "../track_handle.ts"; export abstract class User { protected el: HTMLElement public local = false - protected tracks: Set = new Set() + public tracks: Set = new Set() private name_el = document.createElement("span") private _name?: string diff --git a/readme.md b/readme.md index 03b2158..735e5a6 100644 --- a/readme.md +++ b/readme.md @@ -48,12 +48,15 @@ Because of a current compiler bug, the nightly rustc crashes during codegen - us ## Keybinds -| Keybind | Action | -| ------- | -------------------- | -| `RET` | Toggle chat | -| `SPC M` | Add microphone track | -| `SPC C` | Add camera track | -| `SPC S` | Add screencast track | +| Keybind | Action | +| --------- | ------------------------------------------------------- | +| `RET` | Toggle chat | +| `SPC M` | Add microphone track | +| `SPC R` | Add microphone track (but with your left hand) | +| `SPC C` | Add camera track | +| `SPC S` | Add screencast track | +| `SPC C-c` | End all tracks | +| `C-v`\* | Paste image in chat (does not require chat to be shown) | ## Parameters -- cgit v1.2.3-70-g09d2