perf: 放行快捷键 ctrl-c-v

This commit is contained in:
ibuler
2023-06-12 16:37:12 +08:00
parent 24272d3162
commit cb2b8bb70b
2 changed files with 6 additions and 3 deletions

View File

@@ -40,9 +40,9 @@ document.addEventListener("contextmenu", function (event) {
event.preventDefault();
});
var AllowedKeys = ['P', 'F', 'p', 'f']
var AllowedKeys = ['P', 'F', 'C', 'V']
window.addEventListener("keydown", function (e) {
if (e.key === "F12" || (e.ctrlKey && !AllowedKeys.includes(e.key))) {
if (e.key === "F12" || (e.ctrlKey && !AllowedKeys.includes(e.key.toUpperCase()))) {
e.preventDefault();
e.stopPropagation();
console.log('Press key: ', e.ctrlKey ? 'Ctrl' : '', e.shiftKey ? ' Shift' : '', e.key)