code: function captureEditorCommand(ed, captureCommandFunc, captureCallFunc) {
    var origCallKeyboardHandlers = ed.keyBinding.$callKeyboardHandlers,
        commandExecHandler = ed.commands.addEventListener('exec', function(e) {
          uninstall();
          e.stopPropagation(); e.preventDefault();
          captureCommandFunc && captureCommandFunc(e.command, e);
          return true;
        });
  
    var orig = ed.keyBinding.$callKeyboardHandlers;
    ed.keyBinding.$callKeyboardHandlers = function(hashId, keyString, keyCode, e) {
      captureCallFunc && captureCallFunc(hashId, keyString, keyCode, e);
      return orig.call(this, hashId, keyString, keyCode, e);
    };
  
    return uninstall;
  
    // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  
    function uninstall() {
      commandExecHandler && ed.commands.removeEventListener('exec', commandExecHandler);
      ed.keyBinding.$callKeyboardHandlers = orig;
    }
  
  }
docs: Commands invoke through key actions or otherwise will be captured after running when while running doFunc and the result returned *instead* of triggering normal actions. This basically overwrites the typical ed.commands.exec handler