www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 2736e7e6d1aa2b6de7e104bbe857f9cf0060eb11
parent 670f272b3252a691b1aa5298a4cf3861e08783da
Author: Dan Stillman <dstillman@zotero.org>
Date:   Sun, 28 Jul 2013 20:18:24 -0400

Use Ctrl-Shift for all shortcuts on Windows/Linux instead of Ctrl-Alt

https://forums.zotero.org/discussion/25927/#Item_5

Diffstat:
Mchrome/content/zotero/overlay.xul | 2+-
Mchrome/content/zotero/preferences/preferences_keys.js | 2+-
Mchrome/content/zotero/xpcom/zotero.js | 14+++++---------
Mchrome/content/zotero/zoteroPane.js | 11+++--------
4 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/chrome/content/zotero/overlay.xul b/chrome/content/zotero/overlay.xul @@ -94,6 +94,6 @@ <key id="key_openZotero" key="Z" oncommand="ZoteroOverlay.toggleDisplay();" - modifiers="accel alt" /> + modifiers="accel shift" /> </keyset> </overlay> diff --git a/chrome/content/zotero/preferences/preferences_keys.js b/chrome/content/zotero/preferences/preferences_keys.js @@ -30,7 +30,7 @@ Zotero_Preferences.Keys = { // Display the appropriate modifier keys for the platform var rows = document.getElementById('zotero-prefpane-keys').getElementsByTagName('row'); for (var i=0; i<rows.length; i++) { - rows[i].firstChild.nextSibling.value = Zotero.isMac ? 'Cmd+Shift+' : 'Ctrl+Alt+'; + rows[i].firstChild.nextSibling.value = Zotero.isMac ? 'Cmd+Shift+' : 'Ctrl+Shift+'; } } }; diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js @@ -2307,20 +2307,16 @@ Zotero.Keys = new function() { * Called by ZoteroPane.onLoad() */ function windowInit(document) { - var useShift = Zotero.isMac; - // Zotero pane shortcut var keyElem = document.getElementById('key_openZotero'); if(keyElem) { var zKey = Zotero.Prefs.get('keys.openZotero'); - // Only override the default with the pref if the <key> hasn't been manually changed - // and the pref has been - if (keyElem.getAttribute('key') == 'Z' && keyElem.getAttribute('modifiers') == 'accel alt' - && (zKey != 'Z' || useShift)) { + // Only override the default with the pref if the <key> hasn't + // been manually changed and the pref has been + if (keyElem.getAttribute('key') == 'Z' + && keyElem.getAttribute('modifiers') == 'accel shift' + && zKey != 'Z') { keyElem.setAttribute('key', zKey); - if (useShift) { - keyElem.setAttribute('modifiers', 'accel shift'); - } } } } diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js @@ -602,17 +602,14 @@ var ZoteroPane = new function() } } - var useShift = Zotero.isMac; - var key = String.fromCharCode(event.which); if (!key) { Zotero.debug('No key'); return; } - // Ignore modifiers other than Ctrl-Alt or Cmd-Shift - if (!((Zotero.isMac ? event.metaKey : event.ctrlKey) && - (useShift ? event.shiftKey : event.altKey))) { + // Ignore modifiers other than Ctrl-Shift/Cmd-Shift + if (!((Zotero.isMac ? event.metaKey : event.ctrlKey) && event.shiftKey)) { return; } @@ -687,9 +684,7 @@ var ZoteroPane = new function() } } // Use key that's not the modifier as the popup toggle - ZoteroPane_Local.newNote( - useShift ? event.altKey : event.shiftKey, parent - ); + ZoteroPane_Local.newNote(event.altKey, parent); break; case 'toggleTagSelector': ZoteroPane_Local.toggleTagSelector();