From 3a95e2e3036277a196a37791d69332f06848ce2f Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Sun, 11 Jul 2021 01:41:13 +0100 Subject: [PATCH] Add Cmd-Shift-[ / ] tab navigation on macOS only --- chrome/content/zotero/zoteroPane.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index f64f579349..cf489ec677 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -567,6 +567,26 @@ var ZoteroPane = new function() } } + // Tab navigation: Cmd-Shift-[ / ] + // Common shortcut on macOS, but typically only supported on that platform to match OS + // conventions users expect from other macOS apps. + if (Zotero.isMac) { + if (event.metaKey && event.shiftKey && !event.altKey && !event.ctrlKey) { + if (event.key == '[') { + Zotero_Tabs.selectPrev(); + event.preventDefault(); + event.stopPropagation(); + return; + } + else if (event.key == ']') { + Zotero_Tabs.selectNext(); + event.preventDefault(); + event.stopPropagation(); + return; + } + } + } + try { // Ignore keystrokes outside of Zotero pane if (!(event.originalTarget.ownerDocument instanceof XULDocument)) {