Handle Apple command key for keybindings
This commit is contained in:
Marcel 2023-01-18 21:43:12 +01:00 committed by GitHub
parent 1d2e42b737
commit c8952e833d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -215,7 +215,7 @@ function toggleEditMode() {
function setupKeybinds() {
window.addEventListener("keydown", (event) => {
// All keybinds in the default button set include the CTRL key
if ((EDIT_MODE && !event.ctrlKey && event.code !== "Escape") || (!EDIT_MODE && !event.ctrlKey)) {
if ((EDIT_MODE && !event.ctrlKey && !event.metaKey && event.code !== "Escape") || (!EDIT_MODE && !event.ctrlKey && !event.metaKey)) {
return;
}
@ -435,4 +435,4 @@ function insertTextAtCursor(element, text) {
range.text = text;
range.select();
}
}
}