From 1217a5409e47aa5f8b685e4f343f1cfd7ca523a2 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 12 Mar 2013 02:13:35 -0400 Subject: [PATCH] Fix Control (and Alt) key shortcuts in items pane on Windows Follow-up to d2f028d and 0a7cc4448 --- chrome/content/zotero/xpcom/itemTreeView.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/itemTreeView.js b/chrome/content/zotero/xpcom/itemTreeView.js index 02d5865a32..9614460140 100644 --- a/chrome/content/zotero/xpcom/itemTreeView.js +++ b/chrome/content/zotero/xpcom/itemTreeView.js @@ -170,6 +170,8 @@ Zotero.ItemTreeView.prototype._setTreeGenerator = function(treebox) return; } + event.preventDefault(); + Q.fcall(function () { var key = String.fromCharCode(event.which); if (key == '+' && !(event.ctrlKey || event.altKey || event.metaKey)) { @@ -215,13 +217,16 @@ Zotero.ItemTreeView.prototype._setTreeGenerator = function(treebox) tree.disableKeyNavigation = false; self._skipKeyPress = true; - var nsIDWU = Components.interfaces.nsIDOMWindowUtils + var nsIDWU = Components.interfaces.nsIDOMWindowUtils; var domWindowUtils = event.originalTarget.ownerDocument.defaultView .QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(nsIDWU); var modifiers = 0; + if (event.altKey) { + modifiers |= nsIDWU.MODIFIER_ALT; + } if (event.ctrlKey) { - modifiers |= nsIDWU.MODIFIER_CTRL; + modifiers |= nsIDWU.MODIFIER_CONTROL; } if (event.shiftKey) { modifiers |= nsIDWU.MODIFIER_SHIFT;