From f35f9f4827f5dbc99aa4f58a1ffc36a2b8d7f3d0 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 1 Feb 2007 19:50:35 +0000 Subject: [PATCH] Addresses #401, Add keyboard shortcuts Default extensions.zotero.keys.overrideGlobal to off --- chrome/content/zotero/overlay.js | 3 +++ chrome/content/zotero/xpcom/zotero.js | 12 ++++++++++++ defaults/preferences/zotero.js | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/overlay.js b/chrome/content/zotero/overlay.js index a602b912e..121dc39a1 100644 --- a/chrome/content/zotero/overlay.js +++ b/chrome/content/zotero/overlay.js @@ -210,6 +210,9 @@ var ZoteroPane = new function() } + /* + * Trigger actions based on keyboard shortcuts + */ function handleKeyPress(event) { // Ignore keystrokes if Zotero pane is closed if (document.getElementById('zotero-pane').getAttribute('hidden') == 'true') { diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index 1cdb46cd6..a6977de4e 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -653,6 +653,12 @@ Zotero.Prefs = new function(){ } +/* + * Handles keyboard shortcut initialization from preferences, optionally + * overriding existing global shortcuts + * + * Actions are configured in ZoteroPane.handleKeyPress() + */ Zotero.Keys = new function() { this.init = init; this.windowInit = windowInit; @@ -663,6 +669,9 @@ Zotero.Keys = new function() { _keys = {}; + /* + * Called by Zotero.init() + */ function init() { // Get the key=>command mappings from the prefs for each (var action in _actions) { @@ -671,6 +680,9 @@ Zotero.Keys = new function() { } + /* + * Called by ZoteroPane.onLoad() + */ function windowInit(document) { var useShift = Zotero.isMac; diff --git a/defaults/preferences/zotero.js b/defaults/preferences/zotero.js index 9de4251c9..d42f9ed0d 100644 --- a/defaults/preferences/zotero.js +++ b/defaults/preferences/zotero.js @@ -21,7 +21,7 @@ pref("extensions.zotero.lastCreatorFieldMode",0); pref("extensions.zotero.lastRenameAssociatedFile", false); // Keyboard shortcuts -pref("extensions.zotero.keys.overrideGlobal", true); +pref("extensions.zotero.keys.overrideGlobal", false); pref("extensions.zotero.keys.openZotero", 'Z'); pref("extensions.zotero.keys.toggleFullscreen", 'F'); pref("extensions.zotero.keys.library", 'L');