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

https://forums.zotero.org/discussion/25927/#Item_5
This commit is contained in:
Dan Stillman 2013-07-28 20:18:24 -04:00
parent 670f272b32
commit 2736e7e6d1
4 changed files with 10 additions and 19 deletions

View file

@ -94,6 +94,6 @@
<key id="key_openZotero"
key="Z"
oncommand="ZoteroOverlay.toggleDisplay();"
modifiers="accel alt" />
modifiers="accel shift" />
</keyset>
</overlay>

View file

@ -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+';
}
}
};

View file

@ -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');
}
}
}
}

View file

@ -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();