diff --git a/frontend/public/copy.wav b/frontend/public/copy.wav new file mode 100644 index 0000000..d052a0e Binary files /dev/null and b/frontend/public/copy.wav differ diff --git a/frontend/src/sound.ts b/frontend/src/sound.ts index fbc9b09..28eb785 100644 --- a/frontend/src/sound.ts +++ b/frontend/src/sound.ts @@ -3,6 +3,7 @@ const audioContext = new AudioContext(); const soundFiles = { intro: 'intro.wav', login: 'login.wav', + copy: 'copy.wav', uploadFailed: 'uploadfail.wav' } as const; diff --git a/frontend/src/views/main.ts b/frontend/src/views/main.ts index 6655e64..bf24b77 100644 --- a/frontend/src/views/main.ts +++ b/frontend/src/views/main.ts @@ -247,6 +247,11 @@ export class MainView extends View { this.openMessageDialog(message); }) itm.onKeyDown(async(key: string, alt: boolean | undefined, shift: boolean | undefined, ctrl: boolean | undefined) => { + if (key === "c") { + navigator.clipboard.writeText(message.content.trim()); + playSound("copy"); + } + if (key === "Delete") { await this.removeMessage(message.id); if (this.messageList.children.length === 0) {