views:

202

answers:

1

Apologies if this question is a bit obscure, I've been banging my head against it for a while and I'm running out of ideas, so I hoped someone here might be able to help.

I'm attempting to use TinyMCE inside of an embedded instance of IE. Weirdly, it's not processing enter/return keypresses. The return keypresses are definitely being received, if I do this:

tinyMCE.init({
    setup : function(ed) {
      ed.onKeyDown.add(function(ed, e) {
       if (e.keyCode == 13) {
         ed.execCommand('mceInsertContent',false,'Hello World!');
       }
      });
     },
...

then "Hello World!" gets inserted wherever my cursor is. I guess a reasonable thing would be to replace the execCommand by a call to whatever code TinyMCE executes on enter keypresses. Does anyone know what that function is, and if it's accessible? If not, does anyone have any other ideas?

Thanks,

Dom

A: 

Turns out that this was because the window that the embedded IE was in was swallowing the keypresses.

Dominic Rodger