diff --git a/chrome/content/zotero/lookup.js b/chrome/content/zotero/lookup.js index 418e0f4bd..b6dc36d7e 100644 --- a/chrome/content/zotero/lookup.js +++ b/chrome/content/zotero/lookup.js @@ -91,6 +91,19 @@ const Zotero_Lookup = new function () { return false; } + /** + * Handles a key press + */ + this.onKeyPress = function(event) { + var keyCode = event.keyCode; + if(keyCode === 13 || keyCode === 14) { + Zotero_Lookup.accept(); + } else if(keyCode == event.DOM_VK_ESCAPE) { + document.getElementById("zotero-lookup-panel").hidePopup(); + } + return true; + } + /** * Focuses the field */ diff --git a/chrome/content/zotero/zoteroPane.xul b/chrome/content/zotero/zoteroPane.xul index 2d17a8d24..f4e94f9c5 100644 --- a/chrome/content/zotero/zoteroPane.xul +++ b/chrome/content/zotero/zoteroPane.xul @@ -145,7 +145,7 @@ onpopuphidden="Zotero_Lookup.onHidden()" noautohide="true"> &zotero.lookup.description; - +