diff --git a/templates/framework_modern.html b/templates/framework_modern.html
index 06ba3ef5..c079b812 100644
--- a/templates/framework_modern.html
+++ b/templates/framework_modern.html
@@ -145,6 +145,30 @@
}
});
+
+ // Global keyboard shortcut for search (Cmd+K on Mac, Ctrl+K on Windows/Linux)
+ document.addEventListener('keydown', function(event) {
+ // Check if user is typing in an input field
+ const activeElement = document.activeElement;
+ const isInputField = activeElement && (
+ activeElement.tagName === 'INPUT' ||
+ activeElement.tagName === 'TEXTAREA' ||
+ activeElement.contentEditable === 'true'
+ );
+
+ if (isInputField) {
+ return; // Don't trigger shortcut when typing in input fields
+ }
+
+ // Check for Cmd+K (Mac) or Ctrl+K (Windows/Linux)
+ const isMac = /Mac/.test(navigator.platform);
+ const isCorrectModifier = isMac ? event.metaKey : event.ctrlKey;
+
+ if (isCorrectModifier && event.key === 'k') {
+ event.preventDefault();
+ window.location.href = '/search';
+ }
+ });