From c3fd958ed7a5a5b97b5a9a063f85f0b91c1026e5 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 25 Oct 2019 15:18:28 -0400 Subject: [PATCH] Fix keyboard shortcuts Regression from 54b268fe01 --- chrome/content/zotero/xpcom/zotero.js | 2 +- chrome/content/zotero/zoteroPane.js | 12 ++---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index 01aad431a6..67d6b34d70 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -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'); diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 9abc9e460a..dfad305ca8 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -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; }