Fix keyboard shortcuts

Regression from 54b268fe01
This commit is contained in:
Dan Stillman 2019-10-25 15:18:28 -04:00
parent d8508415b9
commit c3fd958ed7
2 changed files with 3 additions and 11 deletions

View file

@ -1788,7 +1788,7 @@ Zotero.Keys = new function() {
// Get the key=>command mappings from the prefs
for (let cmd of cmds) {
cmd = cmd.substr(5); // strips 'keys.'
cmd = cmd.replace(/^extensions\.zotero\.keys\./, '');
// Remove old pref
if (cmd == 'overrideGlobal') {
Zotero.Prefs.clear('keys.overrideGlobal');

View file

@ -624,11 +624,8 @@ var ZoteroPane = new function()
event.preventDefault();
return;
}
var key = String.fromCharCode(event.which);
if (key) {
var command = Zotero.Keys.getCommand(key);
}
var command = Zotero.Keys.getCommand(event.key);
if (from == 'zotero-collections-tree') {
if ((event.keyCode == event.DOM_VK_BACK_SPACE && Zotero.isMac) ||
@ -689,11 +686,6 @@ var ZoteroPane = new function()
return;
}
if (!key) {
Zotero.debug('No key');
return;
}
if (!command) {
return;
}