From d65201202da9b7e777f28da97b31e3a1c3019c2a Mon Sep 17 00:00:00 2001 From: Wim Brand Date: Tue, 14 Jan 2020 17:22:24 +0100 Subject: [PATCH] copy shortcut --- res/include/script/home_plain.js | 8 ++++++++ res/template/file_viewer.html | 2 +- res/template/home.html | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/res/include/script/home_plain.js b/res/include/script/home_plain.js index 596e664..3aeadda 100644 --- a/res/include/script/home_plain.js +++ b/res/include/script/home_plain.js @@ -92,6 +92,14 @@ function shareButton() { }); } +document.addEventListener("keydown", function(event){ + if (event.ctrlKey || event.altKey) { + return // prevent custom shortcuts from interfering with system shortcuts + } + if (event.which == 67 && !uploader.uploading()) { // C to copy to clipboard + copyLink(); + } +}); function copyLink() { if(copyText(shareLink)) { console.log('Text copied'); diff --git a/res/template/file_viewer.html b/res/template/file_viewer.html index 0a5ad96..a988d8b 100644 --- a/res/template/file_viewer.html +++ b/res/template/file_viewer.html @@ -103,7 +103,7 @@