From 2736e7e6d1aa2b6de7e104bbe857f9cf0060eb11 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 28 Jul 2013 20:18:24 -0400 Subject: [PATCH] Use Ctrl-Shift for all shortcuts on Windows/Linux instead of Ctrl-Alt https://forums.zotero.org/discussion/25927/#Item_5 --- chrome/content/zotero/overlay.xul | 2 +- .../content/zotero/preferences/preferences_keys.js | 2 +- chrome/content/zotero/xpcom/zotero.js | 14 +++++--------- chrome/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 index 61091ca1e..c77b4bdfc 100644 --- a/chrome/content/zotero/overlay.xul +++ b/chrome/content/zotero/overlay.xul @@ -94,6 +94,6 @@ + modifiers="accel shift" /> diff --git a/chrome/content/zotero/preferences/preferences_keys.js b/chrome/content/zotero/preferences/preferences_keys.js index 3c544cd75..748f05adc 100644 --- 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 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 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 index 6117e958b..2cd3bed8a 100644 --- 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();