From 6ca77eeddec2de6cf56b35c9648ba10411f2a89f Mon Sep 17 00:00:00 2001 From: Jade Macho Date: Wed, 15 May 2024 00:10:38 +0200 Subject: [PATCH] Screenshot: Bind CTRL+C --- mods/Screenshot.js | 6 ++++++ mods/Transcript.js | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mods/Screenshot.js b/mods/Screenshot.js index 271a466..389d031 100644 --- a/mods/Screenshot.js +++ b/mods/Screenshot.js @@ -27,6 +27,12 @@ export default JadefinIntegrity("Screenshot", import.meta.url, () => new (class this.copy(); } }); + + document.addEventListener("keydown", e => { + if (e.ctrlKey && e.code == "KeyC" && JadefinUtils.video) { + this.copy(); + } + }); } copy() { diff --git a/mods/Transcript.js b/mods/Transcript.js index 8913726..8ab5026 100644 --- a/mods/Transcript.js +++ b/mods/Transcript.js @@ -80,7 +80,7 @@ export default JadefinIntegrity("Transcript", import.meta.url, () => new (class JadefinUtils.events.addEventListener(JadefinUtils.eventTypes.WORKER_CREATED, e => { const detail = e["detail"]; - // TODO: 10.9 replaces JSSO / libssa-js with JASSUB, revisit once that's stable. + // TODO: 10.9 should've replaced JSSO / libssa-js with JASSUB, revisit once that's stable. if (!detail.args.scriptURL.endsWith("/libraries/subtitles-octopus-worker.js")) { return; } @@ -297,7 +297,7 @@ export default JadefinIntegrity("Transcript", import.meta.url, () => new (class } // The canvas gets added relatively early, therefore hook drawImage. - // TODO: 10.9 replaces JSSO / libssa-js with JASSUB, revisit once that's stable. + // TODO: 10.9 should've replaced JSSO / libssa-js with JASSUB, revisit once that's stable. const canvas = JadefinUtils.video.parentNode?.querySelector("canvas"); const ctx = canvas?.getContext("2d");