Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix alt shortcuts on mac not triggering
chloelee767644cc27fa709
diff --git a/apps/client/src/services/shortcuts.ts b/apps/client/src/services/shortcuts.tsindex 167dc01d99..63db45302d 100644--- a/apps/client/src/services/shortcuts.ts+++ b/apps/client/src/services/shortcuts.ts@@ -213,8 +213,11 @@ export function keyMatches(e: KeyboardEvent, key: string): boolean {}// For letter keys, use the physical key code for consistency+ // On macOS, Option/Alt key produces special characters, so we must use e.codeif (key.length === 1 && key >= 'a' && key <= 'z') {- return e.key.toLowerCase() === key.toLowerCase();+ // e.code is like "KeyA", "KeyB", etc.+ const expectedCode = `Key${key.toUpperCase()}`;+ return e.code === expectedCode || e.key.toLowerCase() === key.toLowerCase();}// For regular keys, check both key and code as fallback