I have build a few custom plugins, but only one is listening to key events of the keyboard. Below in the code you can see the set-up to set the events. (and it's kinda basic)

Now i have the following problem that if i set my data with editor.setData in a instanceReady listener.that the .on functions aren't set.

I did try to replace the contentDom with the instanceReady event, but that doesn't fix it either.

if i set the data manualy with: editor.document.getBody().setHtml(html), there are no problems. and all events are attached without any problems..

CKEDITOR.plugins.add( 'myPlugin', {
    lang: '', // %REMOVE_LINE_CORE% 

    init: function( editor ) {

        //Bind events if the Dom is ready!
        editor.on( 'contentDom', function()
        {
                //keydown
                editor.document.on('keydown', function(e)
                {

Does anyone know why this is happening? Does the setData function only set the html or does it also reload the editor or something?

I did take a look at this Ckeditor Source But i think that this isn't code that has something to do with the setData function.

I'm not asking for a solution. I like to understand why it's happening.

Edit
Report