add:  if (accel && typeof(accel.key) == "string")  { var accelText = ""; if (accel.accel) { accelText += "<accel> + "; accel.accel = true; } else { accel.accel = false; } if (accel.ctrl) { accelText += "<ctrl> + "; accel.ctrl = true; } else { accel.ctrl = false; } if (accel.meta) { accelText += "<meta> + "; accel.meta = true; } else { accel.meta = false; } if (accel.shift) { accelText += "<shift> + "; accel.shift = true; } else { accel.shift = false; } if (accel.alt) { accelText += "<alt> + "; accel.alt = true; } else { accel.alt = false; } accelText += accel.key;  menuItem.setAttribute("acceltext", accelText); alert( menuItem.getAttribute("acceltext") ); getActiveDocument().addEventListener("keypress", function(e){ if (/*(e.accelKey == accel.accel) &&*/ (e.ctrlKey == accel.ctrl) && (e.metaKey == accel.meta) && (e.shiftKey == accel.shift) && (e.altKey == accel.alt) && (String.fromCharCode(e.which) == accel.key)) { commandFunc(); } }, false); } 
context:   function registerMenuCommand(docId, commandName, commandFunc) {    var menuItem;    var previousItems;        menuItem = window.document.createElement('menuitem');    menuItem.setAttribute("label", commandName);    menuItem.__gmCommandFunc = function(e) {commandFunc()};    //menuItem.addEventListener("command", commandFunc, false);    previousItems = docMenuCommands[docId].childNodes;        var i=0;    var nextNode=null;    while (i < previousItems.length) {      if (commandName.toLowerCase() <           previousItems[i].getAttribute('label').toLowerCase())       {        nextNode = previousItems[i];        break;      }      i++;    }    docMenuCommands[docId].insertBefore(menuItem, nextNode);  }
meta: 4236	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4236/904826b1a895d0db9b1b022eb38190c51df5f2d6/greasemonkey.js/buggy/src/content/greasemonkey.js