title: Listener Events being reset on setData and mode change, using CKEditor
body: <p>Whenever my script calls setData or changes the mode ("source", "WYSIWYG"), the Listeners for the Events I have assigned, are no longer called.</p>
  
  <p>Research has taught me why and I have been experimenting with suggested solutions (<a href="https://stackoverflow.com/questions/16054070/ckeditor-setdata-prevents-attaching-of-events-with-on-function">CKEDITOR.setData prevents attaching of events with .on function</a>), including those from the official documentation (<a href="http://docs.ckeditor.com/#!/api/CKEDITOR.editor-event-contentDom" rel="nofollow noreferrer">http://docs.ckeditor.com/#!/api/CKEDITOR.editor-event-contentDom</a>), but none of the resolutions work for me as documented, and I have no idea why.</p>
  
  <p>Has anyone else here managed to resolve this issue? If so, I would be most grateful to find out how.</p>
  
  <p>We are current running version 4.5.10 of CKEditor.</p>
  
  <p>Thanking you in anticipation.
  Ken.</p>
  
  <p>Example:</p>
  
  <pre><code>// Works until setData() is called or until the view mode is changed ("WYSIWYG", "SOURCE).
  
  ev.editor.document.on( 'keydown', function( evt )
  {
      console.log("Key Down");
  });
  
  // This appears to be the recommended resolution however, this does not
      // work for me even prior to setData() being called of the view mode being changed.
  
      editor.on( 'contentDom', function() {
      var editable = editor.editable();
  
      editable.attachListener( editor.document, 'keydown', function() {
      console.log("Key Down"); // Never executed
          } );
      } );
  </code></pre>
  
  <p>UPDATE: This solution (suggested by Dekel) looks to me as it should work. However, I suspect that I have not implemented it correctly so the Key Down event is not firing. Any thoughts on this:</p>
  
  <pre><code>for (var i in CKEDITOR.instances) {
      CKEDITOR.instances[i].on('contentDom', function() {
          CKEDITOR.instances[i].document.on('keydown', function(event) {
              console.log('key down')
          });
      });
  }
  </code></pre>
  
  <p>UPDATE: Full code example. The event no longer appears to fire:</p>
  
  <pre><code>    &lt;html&gt;
  
  &lt;textarea name="editor1"&gt;
  &lt;/textarea&gt;
  
  &lt;textarea name="editor2"&gt;
  &lt;/textarea&gt;
  
  &lt;textarea name="editor3"&gt;
  &lt;/textarea&gt;
  
  &lt;/html&gt;
  
  &lt;script&gt;
  
  CKEDITOR.replace( 'editor1', {
    allowedContent: true
  });
  
  CKEDITOR.replace( 'editor2', {
    allowedContent: true
  });
  
  CKEDITOR.replace( 'editor3', {
    allowedContent: true
  });
  
  for (var i in CKEDITOR.instances) {
      CKEDITOR.instances[i].on('contentDom', function() {
          CKEDITOR.instances[i].document.on('keydown', function(event) {
              console.log('key down')
          });
      });
  }
  
  &lt;/script&gt;
  </code></pre>