title: undo/redo event binding
body: <p>I found some interesting javascript undo managers and –of course– we have the one that will be eventually implemented in the browser with HTML5.</p>
  
  <p>Now, what I'm not sure about is how to capture user actions meant to trigger 'undo' with jQuery to drive the UndoManager:</p>
  
  <ul>
  <li>Ctrl+Z, Ctrl+Shift+Z</li>
  <li>Cmd+Z,  Cmd+Shift+Z</li>
  <li>User clicking on the <em>Edit>Undo</em> or <em>Edit>Redo</em> menu in their browsers</li>
  </ul>
  
  <p>My first stab at it would be this:</p>
  
  <pre><code>function keypress(e){
    if (e.metaKey) {
      Collage.console(e);
      switch(e.keyCode){
      case 122: // Mac
        if (e.shiftKey) {
          undoManager.redo(e);
        } else {
          undoManager.undo(e);
        }
      case 26: // PC
        if (e.shiftKey) {
          undoManager.redo(e);
        } else {
          undoManager.undo(e);
        }
      }
    }
  };
  
  $('#my-thing-with-undos').bind('keypress', keypress);
  </code></pre>
  
  <p>but how do I ensure that the (modern) browser's Edit menu keeps up with the program?</p>
  
  <p>I really don't want the browser to attempt to figure out what and how to undo in that region or, at least, not to perform an edit to it (it's a <code>contenteditable = true</code> region).</p>