copy shortcut

This commit is contained in:
2020-01-14 17:22:24 +01:00
parent 981a85c63e
commit d65201202d
3 changed files with 10 additions and 2 deletions

View File

@@ -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');